Mantis - Resin
Viewing Issue Advanced Details
3059 minor always 11-09-08 00:56 08-13-09 16:23
masum  
ferg  
normal  
closed 3.2.1  
fixed  
none    
none 4.0.2  
0003059: javax.servlet.foward.* request attributes not set if the request is wrapped
If a servlet filter wraps a request with a subclass of HttpServletRequestWrapper, when the request is forwarded (say to a JSP), the javax.servlet.foward.* attributes are not set in the request. These attributes are supposed to be set in a forwarded request according to the 2.4 servlet specs. The issue is present in both 3.2.x and 3.1.x branches.
The issue is probably in the RequestDispatcherImpl.forward(request, response, method, invocation) method. I tried to understand the code flow, but it is difficult without understanding the design scenario. The code sets the attributes in the sub request, but then passes on the top request to the invocation.

Notes
(0003832)
rymsha   
02-21-09 12:31   
We have the same issue when using Spring Security (which uses HttpServletRequestWrapper) and JstlView
which extends InternalResourceView (to render jsps)

Here is BTW a javadoc from InternalResourceView setExposeForwardAttributes method

/**
* Set whether to explictly expose the Servlet 2.4 forward request attributes
* when forwarding to the underlying view resource.
*

Default is "true" on Servlet containers up until 2.4, and "false" for
* Servlet 2.5 and above. Note that Servlet containers at 2.4 level and above
* should expose those attributes automatically! This InternalResourceView
* feature exists for Servlet 2.3 containers and misbehaving 2.4 containers.
*/
 

The only one workaround I found:
use <property name="alwaysInclude" value="true"/>
for InternalResourceViewResolver

(0004121)
ferg   
08-13-09 16:23   
server/10y9