redirect struts 2 action to struts 1 action
We have been using struts 1 since long time. I don't know much about struts 2. Our company is going with component based arch. Core UI components are using struts 1. Core components will be used by old struts 1 components as well as new struts 2 components. I am not really sure if struts 1 action request can be redirected to struts 2 action or vice versa. e.g. We have a listing framework which is made in struts 1. Rendering of listing page will happen using this framework. Now if user perform any operation by selecting the record on listing screen, struts 2 action will be called and after completion of request it will be redirected back to the li开发者_运维问答sting page(which is struts 1 action).
To redirect a struts2 action to a struts1 action, put the following in your struts 2 struts.xml file:
<action name="myAction" class="myClass" method="execute">
<result name="success">/mystruts2page.jsp</result>
<result name="mystruts1redirect" type="redirect">
<param name="location">/MyStruts1Action.do?submit=View&noticeId= ${nextNoticeId </param>
</result>
<interceptor-ref name="myInterceptorStack"/>
</action>
Note that you must use "& amp;" (with no space) and "${field}" for OGNL parameters to be parsed/passed correctly.
精彩评论