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

[jira] [Resolved] (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:all-tabpanel ]

Lukasz Lenart resolved WW-3879.
-------------------------------

    Resolution: Fixed
      Assignee: Lukasz Lenart

Solved, thanks for reporting!
                
> 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