This appears to be already fixed on xenial.
Here is the old repro case, which no longer triggers a bug:
# lxc launch ubuntu:xenial tester && lxc exec tester bash # apt update && apt dist-upgrade -y && apt install -y tomcat8 # mkdir /var/lib/tomcat8/webapps/test && echo "<%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <title>$Title$</title> </head> <body> <% Class.forName("org"); %> </body> </html> " >/var/lib/tomcat8/webapps/test/test.jsp # curl localhost:8080/test/test.jsp ... An exception occurred processing JSP page /test.jsp at line 8 5: </head> 6: <body> 7: <% 8: Class.forName("org"); 9: %> 10: </body> 11: </html> ... </pre><p><b>root cause</b></p><pre>java.lang.StringIndexOutOfBoundsException: String index out of range: 3 ...
Please test to make sure this fixes it for you as well on xenial.
This appears to be already fixed on xenial.
Here is the old repro case, which no longer triggers a bug:
# lxc launch ubuntu:xenial tester && lxc exec tester bash tomcat8/ webapps/ test && echo "<%@ page contentType= "text/html; charset= UTF-8" language="java" %> $Title$ </title> forName( "org"); tomcat8/ webapps/ test/test. jsp 8080/test/ test.jsp "org& quot;); b></p>< pre>java. lang.StringInde xOutOfBoundsExc eption: String index out of range: 3
# apt update && apt dist-upgrade -y && apt install -y tomcat8
# mkdir /var/lib/
<html>
<head>
<title>
</head>
<body>
<%
Class.
%>
</body>
</html>
" >/var/lib/
# curl localhost:
...
An exception occurred processing JSP page /test.jsp at line 8
5: </head>
6: <body>
7: <%
8: Class.forName(
9: %>
10: </body>
11: </html>
...
</pre><p><b>root cause</
...
Please test to make sure this fixes it for you as well on xenial.