Mantis - Resin
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
875 | minor | always | 01-18-06 14:38 | 02-01-06 16:39 | |
|
|||||
Reporter: | koreth | Platform: | |||
Assigned To: | ferg | OS: | |||
Priority: | normal | OS Version: | |||
Status: | closed | Product Version: | 3.0.17 | ||
Product Build: | Resolution: | fixed | |||
Projection: | none | ||||
ETA: | none | Fixed in Version: | 3.0.18 | ||
|
|||||
Summary: | 0000875: Nested servlet forwarding goes to the wrong destination when using HttpServletRequestWrapper | ||||
Description: |
Suppose I have a servlet (call it /s1) that allocates an HttpRequestWrapper subclass. Then it does request.getRequestDispatcher("/s2").forward(myWrappedRequest, response); Now servlet 2 does the same thing: request.getRequestDispatcher("/s3").forward(anotherWrappedRequest, response); The second forward goes to /s2 again, rather than to /s3. /s2 tries to forward to /s3 again, and you quickly get a "too many servlet includes" error. The problem appears to be in RequestDispatcherImpl.java, which walks up the chain of HttpServletRequestWrapper objects to find the topmost ("real") request. It then calls invocation.service(topRequest, res) -- which services the innermost HttpServletRequestWrapper, not the newly constructed request wrapper that it has just pieced together. Changing line 268 of RequestDispatcherImpl.java from invocation.service(topRequest, res); to invocation.service(subRequest, res); appears to fix the problem, and I haven't noticed any bad side effects. But my knowledge of Resin's request handling internals is next to nonexistent so that may not be the right fix. |
||||
Steps To Reproduce: | |||||
Additional Information: | |||||
Relationships | |||||
Attached Files: |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|