Gary,Sheng created WW-3879:
------------------------------

             Summary: 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
             Fix For: Future


I add a parameter in result node like following:
<result name="success" type="redirectAction">
        <param name="actionName">ViewData!default?sorterStr=${sorter}</param>
        <param name="namespace">/admin</param>
</result>
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/ViewCertInfos!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:

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);
    }
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

Reply via email to