https://bz.apache.org/bugzilla/show_bug.cgi?id=68495

--- Comment #7 from Noah Adams <nad...@cirqular.com> ---
Created attachment 39607
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=39607&action=edit
Sample web application to reproduce bug

I am attaching a very simple web application that reliably reproduces this bug.
To create this, I started with the "Hello World" Tomcat sample war and modified
only hello.jsp, web.xml and added a Login.jsp.

This application is expecting an authentication realm named "cortrac-login".
You could change this in web.xml. We are using Active Directory for
authentication, but I wouldn't think that would matter.

To reproduce the bug:
1) Navigate to sample/hello.jsp. It should prompt you to login.
2) After logging in, let the session expire. I set the session timeout to 1
minute for easy testing
3) Click the button on the page. If your session expired, you should be
prompted to login again and after you do, you will see the error.

Note the 2 lines in the hello.jsp
<%= request.getParameter("navCurrentRid") %> 
<%= request.getContextPath() %>


These 2 lines appear to be the core of the bug.  The request.getParameter seems
to be corrupting the URI causing the request.getContextPath to error.

Please let me know if you need more information.
  -Noah

Error returned:

Type Exception Report

Message An exception occurred processing [/hello.jsp] at line [21]

Description The server encountered an unexpected condition that prevented it
from fulfilling the request.

Exception

org.apache.jasper.JasperException: An exception occurred processing
[/hello.jsp] at line [21]

18: </table>
19: 
20: <%= request.getParameter("navCurrentRid") %> 
21: <%= request.getContextPath() %>
22: 
23:                  <form  action="" method="post" id="quicksearchform"
name="quicksearchform">
24: <input id="lname" name="lname" type="hidden"><input id="fname" name="fname"
type="hidden"><input id="bed" name="bed" type="hidden"><input id="ssn"
name="ssn" type="hidden"><input id="idnum" name="idnum" type="hidden"><input
id="topNavSearch" name="topNavSearch" type="hidden" value="true">


Stacktrace:
       
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:610)
       
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:489)
       
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:327)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:623)
        org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
       
org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:129)
Root Cause

java.lang.IllegalStateException: Unable to find match between the canonical
context path [/sample] and the URI presented by the user agent
[e=&fname=&bed=&ss]
        org.apache.catalina.connector.Request.getContextPath(Request.java:2136)
       
org.apache.catalina.connector.RequestFacade.getContextPath(RequestFacade.java:583)
        org.apache.jsp.hello_jsp._jspService(hello_jsp.java:139)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:623)
       
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:466)
       
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:327)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:623)
        org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
       
org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:129)
Note The full stack trace of the root cause is available in the server logs.

-- 
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