You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by John O'Hanley <jo...@pei.sympatico.ca> on 2008/03/08 03:22:02 UTC
RequestDispatcher, wrapper, and file upload [REPEAT]
[One more time - single .zip attached....sorry....]
Hello,
I have a nagging problem with a wrapper-filter for file upload requests. The core of the problem is that
request.getRequestDispatcher(String aPath)
is not behaving as expected. I am passing *query params* in 'aPath'. When I use a file upload wrapper on the request, these query params are not visible to the target JSP.
Attached is a minimal harness to demonstrate the problem. It uses a Controller that traps all '*.test' requests, and does a hard-coded forward to 'test.jsp?x=1', using RequestDispatcher.
The test.jsp displays all request params that it can see. It also does double duty by POSTing data to the Controller.
When (and only when) the FileUploadWrapper is used, the hard-coded x=1 param is no longer visible in test.jsp - that is the issue. Am I missing something?
For reference :
The docs for ServletRequestWrapper:
http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequestWrapper.html#getRequestDispatcher(java.lang.String)
The wrapper I am using (FileUploadWrapper):
- extends HttpsServletRequestWrapper
- does not override getRequestDispatcher(String)
Hence :
- the default impl in ServletRequestWrapper is used for getRequestDispatcher(String)
- that impl does a call-forward to the underlying request (right?)
Given that, why does it fail? Is there something different about file upload requests that makes this fail? Why? It's not that the forward fails entirely - only that the *params* are not passed along.Using Tomcat 5.5.23 on Win XP.
Thanks in advance,John O'Hanley