Anonymous | Login | Signup for a new account | 12-17-2024 08:42 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 | ||||
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 | ||||||
Status | closed | Product Version | 4.0.15 | ||||||
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. |
||||||||
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. |