You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2002/11/27 20:07:41 UTC

DO NOT REPLY [Bug 14908] New: - Redirect creates bad url

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14908>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14908

Redirect creates bad url

           Summary: Redirect creates bad url
           Product: Struts
           Version: 1.1 Beta 2
          Platform: All
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Controller
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: richeyhurst@yahoo.com


When I set the redirect attribute to "true" of an action forward I get a bad 
url.  When I set the redirect attribute to false it works just fine.

Here is the action forward:
<forward name="success"
        path="/admin/user_account.jsp"
        redirect="true"/>

I traced the code and it appears the problem is in 
RequestProcessor.processForwardConfig(HttpServletRequest request,
                                        HttpServletResponse response,
                                        ForwardConfig forward).

If redirect is set to true then it does the following:

 response.sendRedirect
                (response.encodeRedirectURL(request.getContextPath() + uri));

The context path is always added before the uri then passed to 
endcodeRedirectURL().  The reuslting URL is 
http://localhost/project/project/admin/user_account.jsp.  The context root has 
been added twice.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>