Bug 52051 - NullPointerException when Jasper tries to compile a directory
Summary: NullPointerException when Jasper tries to compile a directory
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Jasper (show other bugs)
Version: trunk
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-18 19:33 UTC by Christopher Schultz
Modified: 2011-10-19 15:17 UTC (History)
0 users



Attachments
Sample webapp that demonstrates the problem. (1.23 KB, application/java-archive)
2011-10-18 19:33 UTC, Christopher Schultz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Schultz 2011-10-18 19:33:51 UTC
Created attachment 27809 [details]
Sample webapp that demonstrates the problem.

STR:

1. Map JspServlet to /jsp/*
2. Create a directory /jsp/dir
3. Make a request to /jsp/dir

Result:
org.apache.jasper.JasperException: File "/jsp/dir" not found
	org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:56)
	org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:410)
	org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:117)
	org.apache.jasper.compiler.JspUtil.getInputStream(JspUtil.java:679)
	org.apache.jasper.xmlparser.XMLEncodingDetector.getEncoding(XMLEncodingDetector.java:109)
	org.apache.jasper.compiler.ParserController.determineSyntaxAndEncoding(ParserController.java:337)
	org.apache.jasper.compiler.ParserController.doParse(ParserController.java:190)
	org.apache.jasper.compiler.ParserController.parseDirectives(ParserController.java:119)
	org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:193)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:644)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:358)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

Expected: 404 Not Found response
Comment 1 Christopher Schultz 2011-10-18 19:35:20 UTC
Stack trace is from Tomcat 7: changing product.
Comment 2 Mark Thomas 2011-10-19 15:17:39 UTC
Fixed in trunk (8.0.x) and 7.0.x and will be included in 7.0.23 onwards.