DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10949>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10949 Jasper2 compile error with struts logic tag & jsp:include, with patch Summary: Jasper2 compile error with struts logic tag & jsp:include, with patch Product: Tomcat 4 Version: Nightly Build Platform: All OS/Version: All Status: NEW Severity: Major Priority: Other Component: Jasper 2 AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] Inside of a JSP file using the struts-logic.tld, the use of jsp:include tag inside of a logic:present tag causes a compiler error. CODE: <logic:present name="prospectForm" property="prospectid"> <jsp:include page="/prospectmenu.jsp" flush="true"/> </logic:present> The error is: Generated servlet error: [javac] Compiling 1 source file /opt2/jakarta-tomcat-4.1.7-LE-jdk14/work/Standalone/localhost/helpdesk/content/p rospectform$jsp.java:371: include(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,java.lang.String,javax.servlet.jsp.JspWriter,bool ean) in org.apache.jasper.runtime.JspRuntimeLibrary cannot be applied to (javax.servlet.http.HttpServletRequest,javax.servlet.ServletResponse,java.lang.String,j avax.servlet.jsp.JspWriter,boolean) JspRuntimeLibrary.include(request, response,"/prospectmenu.jsp", out, true); ^ 1 error The code generated is in correct. JspRuntimeLibrary.include signature wants (HttpServletRequest,HttpServletResponse,String,JspWriter,boolean) What is generated is (HttpServletRequest,ServletResponse,String,JspWriter,boolean) CODE GENERATED: private boolean _jspx_meth_logic_present_0(javax.servlet.jsp.tagext.Tag _jspx_th_html_form_0, javax.servlet.jsp.PageContext pageContext) throws Throwable { JspWriter out = pageContext.getOut(); HttpServletRequest request = (HttpServletRequest)pageContext.getRequest(); ServletResponse response = pageContext.getResponse(); /* ---- logic:present ---- */ { [SNIP] JspRuntimeLibrary.include(request,response,"/prospectmenu.jsp",out,true); The pageContext.getResponse() needs to be cast to a HttpServletResponse. PATCH: diff -wruN /var/tmp/bpm/Generator.java.~1~ src/share/org/apache/jasper/compiler/Generator.java --- /var/tmp/bpm/Generator.java.~1~ Thu Jun 27 12:32:17 2002 +++ src/share/org/apache/jasper/compiler/Generator.java Tue Jul 16 10:46:17 2002 @@ -1155,7 +1155,7 @@ out.println("HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();"); } if (n.isHasIncludeAction()) { - out.println("ServletResponse response = pageContext.getResponse();"); + out.println("HttpServletResponse response = (HttpServletResponse)pageContext.getResponse();"); } } -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>