Hello, probably due to fix in bug #28222 (but this is not confirmed) getRequestURL() doesn't work like described in http://jakarta.apache.org/tomcat/tomcat-5.5-doc/servletapi/javax/servlet/http/HttpServletRequest.html#getRequestURL() javadoc page. This is most visible when using struts. When users request address (i.e.) http://localhost/struts_action.do (which is purely forward action) requestURL() used in jsp page where this action forwards returns address of that page (however address in browser is still struts action). This violates sentence from api docs that requestURL() "Reconstructs the URL the client used to make the request." Above behaviour breaks applications which depend on it. With Tomcat 5.0.48 requestURL() works correctly. Radoslaw Grzanka
*** This bug has been marked as a duplicate of 28222 ***
O just installed tomcat 5.5.9 and got the same problem. This hasn't been corrected in release 5.5.7? I already read the other bug reports and doesn't seems to me that the bug has been solved, that's because I'm reopening this. I'll try to analyse the sources to find out some way I can contribute.
This is a duplicate and will not be changed.
This is a duplicate and will not be changed. *** This bug has been marked as a duplicate of 28222 *** *** This bug has been marked as a duplicate of 28222 ***
(In reply to comment #4) > This is a duplicate and will not be changed. > > *** This bug has been marked as a duplicate of 28222 *** > > *** This bug has been marked as a duplicate of 28222 *** Once this bug "is a duplicate and will not be changed", should I assume getRequestURL() behaviour won't change, despite it's return value isn't consistent with servlet specification? Or is it consistent? Should I look for another solution, change my code? I'm sorry for the inconvenient question, but I'm really looking for clarification here.
The return value is as required by SRV8.4 The javadocs are, in my view, misleading as none of them take any account of the requirements of SRV8.4 If you want the original request, then obtain it as per SRV.8.4.2 There was some debate about this change on the tomcat-dev list but the conclusion was that the current behaviour is the correct one.
Thanks Mark. This really helped. (In reply to comment #6) > The return value is as required by SRV8.4 > > The javadocs are, in my view, misleading as none of them take any account of the > requirements of SRV8.4 > > If you want the original request, then obtain it as per SRV.8.4.2 > > There was some debate about this change on the tomcat-dev list but the > conclusion was that the current behaviour is the correct one.
I don't know how to obtain origianl request url. I used the request.getAttribute("javax.servlet.forward.request_uri") and it returned the same thing as the request.getURI(). Can anyone give an example? (In reply to comment #7) > Thanks Mark. This really helped. > (In reply to comment #6) > > The return value is as required by SRV8.4 > > > > The javadocs are, in my view, misleading as none of them take any account of the > > requirements of SRV8.4 > > > > If you want the original request, then obtain it as per SRV.8.4.2 > > > > There was some debate about this change on the tomcat-dev list but the > > conclusion was that the current behaviour is the correct one.