markt 2005/01/15 12:27:05 Modified: catalina/src/share/org/apache/catalina/core ApplicationHttpRequest.java Log: Fix bug 28222. request.getRequestURL() in forwarded jsp/servlet returns original url rather than new url as per SRV8.4. Uses same code as CoyoteRequest.getRequestURL() Revision Changes Path 1.15 +28 -1 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationHttpRequest.java Index: ApplicationHttpRequest.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationHttpRequest.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- ApplicationHttpRequest.java 22 Dec 2004 23:12:50 -0000 1.14 +++ ApplicationHttpRequest.java 15 Jan 2005 20:27:05 -0000 1.15 @@ -325,6 +325,33 @@ /** + * Override the <code>getRequestURL()</code> method of the wrapped + * request. + */ + public StringBuffer getRequestURL() { + + StringBuffer url = new StringBuffer(); + String scheme = getScheme(); + int port = getServerPort(); + if (port < 0) + port = 80; // Work around java.net.URL bug + + url.append(scheme); + url.append("://"); + url.append(getServerName()); + if ((scheme.equals("http") && (port != 80)) + || (scheme.equals("https") && (port != 443))) { + url.append(':'); + url.append(port); + } + url.append(getRequestURI()); + + return (url); + + } + + + /** * Override the <code>getServletPath()</code> method of the wrapped * request. */
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]