Bug 39175 - HttpServletRequest.getRequestURL() doesn't behave properly on error page
Summary: HttpServletRequest.getRequestURL() doesn't behave properly on error page
Status: RESOLVED INVALID
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Servlet & JSP API (show other bugs)
Version: 5.5.16
Hardware: All All
: P4 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-31 23:41 UTC by steve5m
Modified: 2006-03-31 15:52 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description steve5m 2006-03-31 23:41:44 UTC
Suppose you have a JSP that throws an exception.
Then you have an error page to deal with the exception.
The error page calls request.getRequestURL().
The bug is that this URL will be ".../error.jsp"
instead of the JSP that was actually requested by the client.
The J2EE 1.4 API spec says "Reconstructs the URL the client used to make the
request".
The client did not request ".../error.jsp", the client requested
the original page that threw the exception.
Note this works as expected in Tomcat 4.1.31 but not 5.5.16.
Note there is another API called getRequestURI, which
has a similar problem although this API works consistently wrong
in Tomcat 4.1.31 also.
Comment 1 william.barker 2006-03-31 23:52:29 UTC
<spec-quote version="2.4" section="9.9.1">
The request path and attributes are set as if a RequestDispatcher.forward to
the error resource had been performed.
</spec-quote>