I have an application that needs to redirect to several internationalized urls, ie
- www.mydomain.com/us/myapp/xxx.action
- www.mydomain.com/fi/myapp/xxx.action
- dwww.mydomain.com/de/myapp/xxx.action
We have a proxy server where the url is mapped to myapp/xxx.action?country=us and redirected to the application server. The problem is how to redirect to the next action with the format above?
Now the url for the next action is generated by using country from url and adding context path and action name and opened by javascript in jsp.
Example:
<body onload="javascript:top.location='${generatedPath}';return true;"></body>
Example form submit:
<s:form id="form" action="%{generatedPath}" theme="simple" method="post" includeContext="false">
Would like to do this in a less hackish way, and have tested a bit with struts.xml and type redirectAction, but cannot seem to be able to generate the url above, with the country before context path. I have not found any struts2 documentation describing this, but are unsure if im looking at the right place as well? Should this be handled elsewhere?