You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by "David Evans (JIRA)" <ji...@apache.org> on 2006/04/25 00:53:10 UTC

[jira] Closed: (STR-1843) Context-relative redirects duplicate context-root in URL (in WAS)

     [ http://issues.apache.org/struts/browse/STR-1843?page=all ]
     
David Evans closed STR-1843:
----------------------------

    Resolution: Fixed

> Context-relative redirects duplicate context-root in URL (in WAS)
> -----------------------------------------------------------------
>
>          Key: STR-1843
>          URL: http://issues.apache.org/struts/browse/STR-1843
>      Project: Struts Action 1
>         Type: Bug

>   Components: Action
>     Versions: 1.1 Final
>  Environment: Operating System: All
> Platform: All
>     Reporter: Anders Wisch
>     Assignee: David Evans

>
> I'm using WSAD 5.1, WAS 4.0.6 Test Server.
> The context-root of my web application as defined in my EAR's deployment
> descriptor is "my_app". To test my application, I navigate to:
> http://localhost:8080/my_app/
> I've got the following global forward in the struts-config.xml for moduleA:
> <forward name="my_forward" redirect="true" contextRelative="true" 
> path="/moduleB/action.do">
> </forward>
> When my action in moduleA returns the ActionForward defined as "my_forward",
> the browser is redirected to:
> http://localhost:8080/my_app/my_app/moduleB/action.do
> Since the global forward is a redirect and context relative, the forward
> path ("/moduleB/action.do") remains unmolested until it reaches this bit
> of Struts code in
> RequestProcessor.processForwardConfig(HttpServletRequest request,
>                                       HttpServletResponse response,
>                                       ForwardConfig forward):
> if (forward.getRedirect()) {
>     // only prepend context path for relative uri
>     if (uri.startsWith("/")) {
>         uri = request.getContextPath() + uri;
>     }
>     response.sendRedirect(response.encodeRedirectURL(uri));        
> }
> The URI passed in to response.encodeRedirectURL is "/my_app/moduleB/action.do"
> since we've prepended the original forward path with the context path. The 
> problem
> seems to be that response.encodeRedirectURL prepends the URI with not only the
> scheme, server, port, etc., but also with same context path.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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