| Anonymous | Login | Signup for a new account | 10-26-2025 14:26 PDT |
| Main | My View | View Issues | Change Log | Docs |
| Viewing Issue Advanced Details [ Jump to Notes ] | [ View Simple ] [ Issue History ] [ Print ] | ||||||||
| ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
| 0004431 | [Resin] | minor | always | 03-09-11 20:10 | 04-06-11 16:41 | ||||
| Reporter | mhixson | View Status | public | ||||||
| Assigned To | ferg | ||||||||
| Priority | normal | Resolution | fixed | Platform | |||||
| Status | closed | OS | |||||||
| Projection | none | OS Version | |||||||
| ETA | none | Fixed in Version | 4.0.17 | Product Version | 4.0.15 | ||||
| Product Build | |||||||||
| Summary | 0004431: Including a query string in resin:Forward's target results in duplicated request parameters | ||||||||
| Description |
Say I include the following in my web.xml: <resin:Forward regexp="^/foo$" target="/bar?a=1" /> And I define the following servlet: @WebServlet(urlPatterns="/bar") public class BarServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.getWriter().write( Arrays.toString( request.getParameterValues("a"))); } } Then I make a request to this URL: /foo?a=2 I see an output of "[2, 1, 2]" rather than the expected "[1, 2]". It seems that any parameters I define in the request are put into the parameter map twice. |
||||||||
| Steps To Reproduce | |||||||||
| Additional Information |
I notice that in my BarServlet example, the following is true: request.getQueryString(); // Returns "a=1&a=2". request.getAttribute( RequestDispatcher.FORWARD_QUERY_STRING); // Returns "a=2". request.getParameterValues("a"); // Appears to be a combination of the // two query strings. That request.getQueryString() is the combination of the one in my resin:Forward rule and in the actual request is different from the behavior of a raw RequestDispatcher.forward call. In that case, request.getQueryString() would be simply "a=1". I have worked around this in my application by extending the com.caucho.rewrite.Forward class, and overriding the rewriteTarget method like so: @Override protected String rewriteTarget(Matcher matcher, String uri, String queryString) { return super.rewriteTarget(matcher, uri, null); } However, I'm guessing that's not the proper solution. |
||||||||
| Attached Files | |||||||||
|
|
|||||||||
| Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
30 total queries executed. 26 unique queries executed. |