https://issues.apache.org/bugzilla/show_bug.cgi?id=55454
Bug ID: 55454
Summary: NullPointerException caused by invalid contentType,
e.g. trailing semicolon
Product: Tomcat 7
Version: 7.0.42
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: Jasper
Assignee: [email protected]
Reporter: [email protected]
possible related to 53353
When having an invalid contenttype like:
<jsp:directive.page language="java" contentType="text/html;"/>
(note the trailing ";") Tomcat throws a NullPointerException like this:
java.lang.NullPointerException
org.apache.tomcat.util.http.parser.HttpParser.parseMediaType(HttpParser.java:217)
org.apache.tomcat.util.http.parser.MediaTypeCache.parse(MediaTypeCache.java:54)
org.apache.catalina.connector.Response.setContentType(Response.java:805)
org.apache.catalina.connector.ResponseFacade.setContentType(ResponseFacade.java:245)
javax.servlet.ServletResponseWrapper.setContentType(ServletResponseWrapper.java:123)
After removing the extra ";" or entering a charset like this:
<jsp:directive.page language="java" contentType="text/html; charset=UTF-8"/>
it works as expected.
My desired behaviour would be:
Don't crash with a NPE.
Other Tomcat versions seem to handly this different.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]