You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Gary,Sheng (JIRA)" <ji...@apache.org> on 2012/09/18 03:29:07 UTC
[jira] [Updated] (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 ]
Gary,Sheng updated WW-3879:
---------------------------
Description:
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/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:
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.
was:
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.
> 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/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:
> 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