Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
glassfishrobot opened this issue Feb 25, 2013 · 4 comments

Comments

@glassfishrobot
Copy link

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
Copy link
Author

@glassfishrobot Commented
Reported by liborjelinek

@glassfishrobot
Copy link
Author

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

@glassfishrobot
Copy link
Author

@markt-asf
Copy link

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

@markt-asf markt-asf transferred this issue from jakartaee/pages Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants