Re: Missing request parameter when pretty request being forwarded.

Splash Forums PrettyFaces Users Missing request parameter when pretty request being forwarded. Re: Missing request parameter when pretty request being forwarded.

#21141

erongd
Participant

Actually the prettyfaces only map the first jsp. The first jsp will forward the request to the second jsp directly on the server side, in the case it adds a query string parameter to the second jsp.

So the flow is this:

/test -> prettyfaces -> /test.jsp -> forwardto -> /test1.jsp?test=1

In this case, if I don’t call the getParameterMap on the request before hitting test1.jsp. Then everything works fine, I can retrieve the parameter “test” in “test1.jsp”. However if I ever call the getParameterMap on “test.jsp”, then I no longer can retrieve the parameter “test” in “test1.jsp”. This seems due to the fact that PrettyFacesWrapperRequst only calls super.getParameterMap() once when getParameterMap() method being called very first time. Afterwards, even though the super.getParameterMap() does return the parameter “test” when called in “test1.jsp”, the getParameterMap() method from PrettyFacesWrapperRequest does not as it no longer calling the super.getParameterMap() thus not getting the updated parameter map.

Seems in most J2EE runtime like jetty, tomcat, they seems to handle forward request specifically by remap the query string just in case someone passing parameter to the forward url.

I will produce a simple test web app that produces the problem.