You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Hudson (JIRA)" <ji...@apache.org> on 2012/09/27 00:21:08 UTC

[jira] [Commented] (WW-3879) Lose context path when add params in result node of struts.xml

    [ https://issues.apache.org/jira/browse/WW-3879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13464243#comment-13464243 ] 

Hudson commented on WW-3879:
----------------------------

Integrated in Struts2 #534 (See [https://builds.apache.org/job/Struts2/534/])
    WW-3879 Changes logic when the location is path and when full url address (Revision 1390692)

     Result = FAILURE
lukaszlenart : 
Files : 
* /struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java
* /struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/ServletRedirectResultTest.java

                
> Lose context path when add params in result node of struts.xml
> --------------------------------------------------------------
>
>                 Key: WW-3879
>                 URL: https://issues.apache.org/jira/browse/WW-3879
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions: 2.3.4.1
>         Environment: all struts release from old to 2.3.4
>            Reporter: Gary,Sheng
>            Assignee: Lukasz Lenart
>             Fix For: 2.3.5
>
>
> I add a parameter in result node like following:
> {code}
> <result name="success" type="redirectAction">
> 	<param name="actionName">ViewData!default?sorterStr=${sorter}</param>
> 	<param name="namespace">/admin</param>
> </result>
> {code}
> sorter value in action is "updated:desc". After this action executed, I got a 404 error, and page address in IE is http://localhost:8080/admin/ViewData!default.jspa?sorterStr=updated:desc
> So the context path is missing. I dubug with struts source code and find the following method in org.apache.struts2.dispatcher.ServletRedirectResult:
> {code}
> private static boolean isPathUrl(String url)
>     {
>         // filter out "http:", "https:", "mailto:", "file:", "ftp:"
>         // since the only valid places for : in URL's is before the path specification
>         // either before the port, or after the protocol
>         return (url.indexOf(':') == -1);
>     }
> {code}
> I sugguest change return to url.substring(0,20).indexOf(':') == -1, this is better.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira