tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 22058] New: - incorrect JSP compilation
Date Fri, 01 Aug 2003 15:25:14 GMT
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=22058>.
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=22058

incorrect JSP compilation

           Summary: incorrect JSP compilation
           Product: Tomcat 5
           Version: 5.0.5
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Jasper2
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: gilles.scokart@axa.be


I have a simple JSP that use a custom tag (file) writen by extending 
SimpleTagSupport.

Here is the JSP :
<%@ taglib uri="c-rt.tld" prefix="b" %>
<%@ taglib uri="templater.tld" prefix="t" %>


<b:forEach begin="0" end="10">
	<t:file name="t">
		<b:if test="true">
		</b:if>
	</t:file>
</b:forEach>

The generated code doesn't compile.  The error is:
_jspx_push_body_count_b_forEach_0 cannot be resolved (in the function invoke_0)

Here is an extract of the generated code:

 private class test_jspHelper
      extends org.apache.jasper.runtime.JspFragmentHelper
  {
    private javax.servlet.jsp.tagext.JspTag parentTag;

    public test_jspHelper( int discriminator, JspContext jspContext, 
javax.servlet.jsp.tagext.JspTag parentTag ) {
      super( discriminator, jspContext, parentTag );
      this.parentTag = parentTag;
    }
    public boolean invoke0( java.io.Writer out ) 
      throws Throwable
    {
      javax.servlet.jsp.tagext.JspTag _jspx_th_t_file_0 = parentTag;
      out.write("\r\n\t\t");
      if (_jspx_meth_b_if_0(_jspx_th_t_file_0, pageContext, 
_jspx_push_body_count_b_forEach_0))
        return true;
      out.write("\r\n\t");
      return false;
    }
    public void invoke( java.io.Writer writer )
      throws javax.servlet.jsp.JspException
    {
      java.io.Writer out = null;
      if( writer != null ) {
        out = this.jspContext.pushBody(writer);
      } else {
        out = this.jspContext.getOut();
      }
      try {
        switch( this.discriminator ) {
          case 0:
            invoke0( out );
            break;
        }
      }
      catch( Throwable e ) {
        if (e instanceof javax.servlet.jsp.SkipPageException)
            throw (javax.servlet.jsp.SkipPageException) e;
        throw new javax.servlet.jsp.JspException( e );
      }
      finally {
        if( writer != null ) {
          this.jspContext.popBody();
        }
      }
    }

Mime
View raw message