如何在给定时间内重定向到 Struts 中的另一个动作? [英] How to redirect to another action in Struts in given time?
本文介绍了如何在给定时间内重定向到 Struts 中的另一个动作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
例如,一旦调用了一个动作,我希望它在 5 秒内重定向到另一个动作.可能吗?
For example, once an action has been called I want it to redirect to another action in 5 seconds. Is it possible?
<action name="proceedupdateaccount" class="accountAction" method="updateAccount">
<result name="success" type="redirectAction">update-message</result>
<result name="input">/accountupdateform.jsp</result>
</action>
<action name="update-message">
<result>/message.jsp</result>
<!-- in 5 seconds this action should redirect to logout action -->
</action>
<action name="logout">
<result type="redirect">/j_spring_security_logout</result>
</action>
推荐答案
您可以使用 <meta http-equiv="refresh" >
简单地将它们从第一个操作重定向到另一个操作第一个动作结果的代码,如下所示:
You can simply redirect them from the first action to another action using the <meta http-equiv="refresh" >
code on the first action's result, like this:
在message.jsp
中:
<meta http-equiv="refresh" content="5;url=logout">
这篇关于如何在给定时间内重定向到 Struts 中的另一个动作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文