tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 39503] New: - getContextPath() returns a decoded string contrary to the servlet spec
Date Sat, 06 May 2006 23:46:56 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39503>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39503

           Summary: getContextPath() returns a decoded string contrary to
                    the servlet spec
           Product: Tomcat 5
           Version: 5.5.17
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Servlet & JSP API
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: crogers@bea.com


This is similar to Bug 39278 but with respect to the request.getContextPath()
method.

The Servlet spec section for request methods, 15.1.3.2, says, "...The container
does not decode this string."

However, if you use a space in the context name and deploy to Tomcat, a call to
getContextPath() does not return an encoded string with '%20' for the space
character. Instead, the string includes the space character. A simple JSP can be
used to reproduce the issue.


Also, I noticed another similar issue with getRequestURI() on a forwarded
request. If you have a servlet or JSP that forwards to another servlet/JSP (via
request.getRequestDispatcher().forward()) in the web app that has a space in the
context path, the forward request behaves differently. The call to
getRequestURI() will return an encoded string from the original request but
returns a decoded URI in the forwarded request. The value in
request.getAttribute("javax.servlet.forward.request_uri") will still contain the
encoded '%20' but getRequestURI() returns a string containing a space. Would you
like me to open a different bug for this issue with respect to forwarding to
track separately?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message