eclipse-ee4j / eclipse-ee4j/wasp

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

Open
#12 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
8
Forks
11
PR merge metrics
No merged PRs in 30d

Description

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

```


/*
/WEB-INF/theme/header.jsp
/WEB-INF/theme/footer.jsp


```

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](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](https://bugs.eclipse.org/bugs/attachment.cgi?id=227465).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.