tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Missing Request Parameters
Date Sat, 29 Jul 2006 13:08:59 GMT
Rache,

> But this usually occur after redirects.

This is what I was going to ask about: if you fail to put all the
important parameters into the redirect, then you will lose them. For
example, if you have a form handler that accepts 5 request parameters,
you cannot simply say:

response.sendRedirect("/foo/bar/baz");

and expect those request parameters to be included for you. You must do
this:

response.sendRedirect("/foo/bar/baz?a=b&c=d&e=g[etc]");

> getRequestDispatcher(url).forward(req, resp);

Forwards should retain the request parameters.

> I've read something with 302 codes/redirects having to cause lost 
> parameter/session info.

This is not an HTTP problem; 302 codes can include complete URLs,
including request parameters and even cookies (since they are just
stored in the HTTP headers). Check your code very carefully to see where
the parameters "disappear", and I think you'll find that you are not
building your URLs for redirection properly.

-chris



Mime
View raw message