eclipse-ee4j / wasp

WaSP, a Jakarta Pages implementation
Eclipse Public License 2.0
8 stars 10 forks source link

StringIndexOutOfBoundsException for "/*" <url-pattern> of <jsp-property-group> #12

Open glassfishrobot opened 11 years ago

glassfishrobot commented 11 years ago

Hi Glassfish developers! Specifying URL pattern "/*" for in web.xml:

<jsp-config>
    <jsp-property-group>
      <url-pattern>/*</url-pattern>
      <include-prelude>/WEB-INF/theme/header.jsp</include-prelude>
      <include-coda>/WEB-INF/theme/footer.jsp</include-coda>
    </jsp-property-group>
  </jsp-config>

causes Glassfish (org.apache.jasper) to crash with HTTP 500

java.lang.StringIndexOutOfBoundsException: String index out of range: 0
    at java.lang.String.charAt(String.java:658)
    at org.apache.jasper.compiler.JspUtil.makeJavaIdentifier(JspUtil.java:1032)
    at org.apache.jasper.JspCompilationContext.getServletClassName(JspCompilationContext.java:403)
    at org.apache.jasper.JspCompilationContext.getClassFileName(JspCompilationContext.java:550)
    at org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:521)
    at org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:488)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:623)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:492)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:378)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
        ...

Originally I found this bug when using Jetty but Jetty just include Glassfish's JSP implementation therefore reporting here. Related Jetty bugzilla issue: https://bugs.eclipse.org/bugs/show_bug.cgi?id=401531

You may will find useful a bug demonstration "hello world" program here https://bugs.eclipse.org/bugs/attachment.cgi?id=227465.

glassfishrobot commented 6 years ago
glassfishrobot commented 11 years ago

@glassfishrobot Commented Reported by liborjelinek

glassfishrobot commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA JSP-36

markt-asf commented 6 years ago

Testing shows this isn't an issue with the upstream Apache Tomcat JSP implementation in any current version. I'm leaving this open as it may be an issue in Glassfish but I suspect it is Jetty specific given https://bugs.eclipse.org/bugs/show_bug.cgi?id=401531#c4