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
<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4"
>
<display-name>Test</display-name>
<description>Test</description>
<filter>
<filter-name>TestFilter</filter-name>
<display-name>TestFilter</display-name>
<filter-class>hirondelle.fish.exercise.fileupload.TestFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>TestFilter</filter-name>
<servlet-name>TestController</servlet-name>
</filter-mapping>
<!-- Required by file upload tool. -->
<listener>
<listener-class>org.apache.commons.fileupload.servlet.FileCleanerCleanup</listener-class>
</listener>
<servlet>
<servlet-name>TestController</servlet-name>
<servlet-class>hirondelle.fish.exercise.fileupload.TestController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>TestController</servlet-name>
<url-pattern>*.test</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>15</session-timeout>
</session-config>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/tlds/c.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/fmt</taglib-uri>
<taglib-location>/WEB-INF/tlds/fmt.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/functions</taglib-uri>
<taglib-location>/WEB-INF/tlds/fn.tld</taglib-location>
</taglib>
</web-app>
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]