struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian P. Millett" <...@ec-group.com>
Subject Jasper error with struts & patch
Date Tue, 16 Jul 2002 16:12:33 GMT

The jsp code it's self:
  <logic:present name="prospectForm" property="prospectid">
       <jsp:include page="/prospectmenu.jsp" flush="true"/>
  </logic:present>

The JSP generated code that is bad:
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 error:
An error occurred at line: 58 in the jsp file: /content/prospectform.jsp

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.se
rvlet.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 problem is that JspRuntimeLibrary.include signature does not match
the code generated:  ServletResponse can not be morphed into a
HttpServletResponse.  So here is a patch, BUT I do not know what else it
will "break".  I figure that someone who "knows" jasper can figure out
what to do. :-)


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();");
                }
            }
 

-- 
Brian Millett                    
Enterprise Consulting Group   "Shifts in paradigms
(314) 205-9030               often cause nose bleeds."
bpm@ec-group.com                           Greg Glenn

Mime
View raw message