Anonymous | Login | Signup for a new account | 12-17-2024 08:44 PST |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0000875 | [Resin] | minor | always | 01-18-06 14:38 | 02-01-06 16:39 | ||||
Reporter | koreth | View Status | public | ||||||
Assigned To | ferg | ||||||||
Priority | normal | Resolution | fixed | ||||||
Status | closed | Product Version | 3.0.17 | ||||||
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. |
||||||||
Additional Information | |||||||||
Attached Files | |||||||||
|
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
34 total queries executed. 28 unique queries executed. |