https://issues.apache.org/bugzilla/show_bug.cgi?id=54249

            Bug ID: 54249
           Summary: Fix JSP compilation problem when application context
                    root contains white spaces
           Product: Tomcat 7
           Version: 7.0.33
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
          Assignee: dev@tomcat.apache.org
          Reporter: polina.gen...@gmail.com
    Classification: Unclassified

Created attachment 29698
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29698&action=edit
Test web application.

Hello, 

I noticed that there is a jsp compilation problem when the application context
root contains white spaces.

Steps to reproduce:
Deploy the attached application and request:
http://<host>:<port>/Space%20AppTest/testClassInvoker.jsp

Then the following exception is received in response:

org.apache.jasper.JasperException: Unable to compile class for JSP
   
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:661)
   
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
root cause 
java.lang.IllegalArgumentException: Negative time
    java.io.File.setLastModified(File.java:1258)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:376)
    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:646)
   
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

I would like to propose a small patch that fixes this. The fix simply moves the
decoding in org.apache.naming.resources.DirContextURLConnection.connect()
method a little bit earlier.
Without the fix path.startsWith(contextPath + "/") check returns false in our
case, as contexPath is in decoded form, while path is not decoded yet.

Thanks and Best Regards,
Polina

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to