Anonymous | Login | Signup for a new account | 12-17-2024 10:35 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 | ||||
0000852 | [Resin] | minor | always | 01-10-06 08:48 | 01-10-06 15:44 | ||||
Reporter | ferg | View Status | public | ||||||
Assigned To | ferg | ||||||||
Priority | urgent | Resolution | fixed | ||||||
Status | closed | Product Version | 3.0.17 | ||||||
Summary | 0000852: jsp:include issue | ||||||||
Description |
(rep by Rudy D'Hauwe) We have an issue with in Resin 3.0.17, here is an example "index.jsp" page: <% String nextPage = "next.jsp?param1=value1"; String param2 = "value2"; String param3 = "value3"; %> The next.jsp page prints the request parameters: param1=<%= request.getParameter("param1"); %> param2=<%= request.getParameter("param2"); %> param3=<%= request.getParameter("param3"); %> With Resin 3.0.17 this results in : param1=value1?param2=value2 param2=null param3=value3 The problem occurs when the page attribute of jsp:include is a runtime-attribute, and contains a query. I implemented a fix for this problem in com.caucho.jsp.java.JspInclude.java. Original code: public void generate(JspJavaWriter out) throws Exception { boolean hasQuery = false; if (_page == null) throw error(L.l(" expects a `page' attribute. `page' specifies the path to include.")); if (hasRuntimeAttribute(_page)) { out.print("pageContext.include("); out.print(getRuntimeAttribute(_page)); } else { String page = _page; out.print("pageContext.include("); out.print(generateParameterValue(String.class, _page)); if (_page.indexOf('?') >= 0) hasQuery = true; } if (_params != null) { generateIncludeParams(out, _params, hasQuery); } out.print(", " + _flush); out.println(");"); } Bug fix replacement for the generate method (not yet optimized for performance) : public void generate(JspJavaWriter out) throws Exception { boolean hasQuery = false; if (_page == null) throw error(L.l(" expects a `page' attribute. `page' specifies the path to include.")); if (hasRuntimeAttribute(_page)) { out.println("if (" + getRuntimeAttribute(_page) + ".indexOf('?')>=0) {"); out.print("pageContext.include("); out.print(getRuntimeAttribute(_page)); if (_params != null) { generateIncludeParams(out, _params, true); } out.print(", " + _flush); out.println(");"); out.println("} else {"); out.print("pageContext.include("); out.print(getRuntimeAttribute(_page)); if (_params != null) { generateIncludeParams(out, _params, hasQuery); } out.print(", " + _flush); out.println(");"); out.println("}"); } else { String page = _page; out.print("pageContext.include("); out.print(generateParameterValue(String.class, _page)); if (_page.indexOf('?') >= 0) hasQuery = true; if (_params != null) { generateIncludeParams(out, _params, hasQuery); } out.print(", " + _flush); out.println(");"); } } |
||||||||
Additional Information | |||||||||
Attached Files | |||||||||
|
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
30 total queries executed. 26 unique queries executed. |