2 Replies Latest reply on Jun 21, 2006 3:44 PM by sjwhyter

    JSP Compile Errors with jsp:includes with JDK 1.5

    sjwhyter Newbie

      I have read the wiki on compiling JSP with JDK 1.5, and this works for most pages, but I am still getting errors when the pages have jsp:includes in them, the error seems to point to not being able to find variable apache.

      An error occurred at line: 555 in the jsp file: /jsp/examMaster/ExamMaster.jsp
      Generated servlet error:
      /opt/JBossJEMS/jboss-4.0.4.GA-src/build/output/jboss-4.0.4.GA/server/default/work/jboss.web/localhost/admin/org/apache/jsp/jsp/examMaster/ExamMaster_jsp.java:663: cannot find symbol
      symbol : variable apache
      location: class com.mycompany.domain.Organization
      org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "ExamCodeAddEdit.jsp" + (("ExamCodeAddEdit.jsp").indexOf('?')>0? '&': '?') + org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode("mode", request.getCharacterEncoding())+ "=" + org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode(String.valueOf( pageAction ), request.getCharacterEncoding()) + "&" + org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode("showBypass", request.getCharacterEncoding())+ "=" + org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode(String.valueOf( showBypass ), request.getCharacterEncoding()), out, true);

        • 1. Re: JSP Compile Errors with jsp:includes with JDK 1.5
          sjwhyter Newbie

          I also wanted to point out that I am not using any 1.5 syntax, just compiling with the following in the web.xml:




          <!-- Uncomment to use jdk1.5 features in jsp pages -->


          <!-- Use a custom options class to allow the shared tag lib descriptors
          to be loaded from jars in the tomcat sar conf/tlds directory. The
          standard options implementation can only find taglibs based on the
          class loader classpath.
          <!-- Specify the jars relative to the jbossweb-tomcat55.sar that should
          be scanned for common tag lib descriptors to include in every war
          MyFaces tlds


          • 2. Re: JSP Compile Errors with jsp:includes with JDK 1.5
            sjwhyter Newbie

            I figured it out. I don't know if this is a bug with Tomcat or not. In the jsp I have a Organization class instance called org:

            Organization org = (Organization) s.getAttribute(Application.SO_ADMIN_ORG);

            and in the jsp I have the following jsp:include:

             Select a School:
             <jsp:include page="../common/SelectOrganization.jsp" flush="true">
             <jsp:param name="value" value="<%= selectedFacilityId %>"/>
             <jsp:param name="applications" value="<%= Application.CORE_RADWEB %>"/>
             <input type="submit" id="btSelect" name="btSubmit" value="Select" class="button" title="Click to view selected schools exam codes."/>

            When this is converted to a servlet, the code that is generated is as follows:

            <td >\n");
             out.write("\t Select a Facility:\n");
             out.write("\t ");
             org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "../common/SelectOrganization.jsp" + (("../common/SelectOrganization.jsp").indexOf('?')>0? '&': '?') + org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode("value", request.getCharacterEncoding())+ "=" + org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode(String.valueOf( selectedFacilityId ), request.getCharacterEncoding()) + "&" + org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode("applications", request.getCharacterEncoding())+ "=" + org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode(String.valueOf( Application.CORE_RADWEB ), request.getCharacterEncoding()), out, true);
             out.write("\t \n");
             out.write("\t <input type=\"submit\" id=\"btSelect\" name=\"btSubmit\" value=\"Select\" class=\"button\" title=\"Click to view selected facility's exam codes.\"/>\n");
             out.write("\t </td>\n");

            When the compiler sees the org.apache.jasper.JspRuntimeLibrary declaration it gives a compile error saying it can not resolve variable apache. It assumes that apache is a variable in the Organization class.

            This worked fine in a earlier version of Tomcat, is this a bug in the jasper tools?