Java Struts在执行动作完成后调用另一个动作 [英] Java Struts call another action after executed action finished

查看:57
本文介绍了Java Struts在执行动作完成后调用另一个动作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Java和Struts2. 在我的struts.xml配置文件中,我具有打击配置.

I'm using Java and Struts2. In my struts.xml configure file i have blow config.

<action name="copyTestSuite" class="testSuiteAction"
    method="copyTestSuite">
    <result name="success">/WEB-INF/jsp/FormSuccessfulWithOutCloseWindow.jsp
    </result>
</action>

执行动作copyTestSuite后,默认页面将转到FormSuccessfulWithOutCloseWindow.jsp.并且此页面仅用于重定向到上一页.

After i executed action copyTestSuite, the default page will go to FormSuccessfulWithOutCloseWindow.jsp. and this page is just used to redirect to previous page.

但是我想让它直接进入另一个与操作匹配的页面.我该怎么办?

But i want to let it go to another action matched page directly. How can i do this?

以下是我要重定向到的UpdateTestSuite的另一项操作:

Below is another action toUpdateTestSuite i want to redirect to:

<action name="toUpdateTestSuite" class="testSuiteAction"
    method="toUpdateTestSuite">
    <result name="success">/WEB-INF/jsp/testsuite/updateTestSuite.jsp
    </result>
</action>

推荐答案

您可以使用此<result type="redirectAction"></result>

<action name="copyTestSuite" class="testSuiteAction"
method="copyTestSuite">
<result type="redirectAction">/newAction.action</result>
</action>

这篇关于Java Struts在执行动作完成后调用另一个动作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆