ExecuteAndWaitInterceptor很适合在后台长时间运行的action时,他可以可为用户一个友好的等待界面,例如进度条。
不在默认的拦截stack 里面,使用的时候需要配置,但必须是在拦截堆栈的最后一个。

复制代码
<action name="someAction" class="com.examples.SomeAction">
    <interceptor-ref name="defaultStack"/>
    <interceptor-ref name="execAndWait">
        <param name="delay">1000<param> <!---wait页面延迟时间,可省略--->
        <param name="delaySleepInterval">50<param><!----检查后天进行是否执行完成的时间可省略--->
    <interceptor-ref>
    <result name="wait">/wait.jsp</result><!---等待时候显示的页面--->
 <result name="success">/welcome.jsp</result>
复制代码

 

wait页面设置

复制代码
<html>
  <head>
    <title>Please wait</title>
    <meta http-equiv="refresh" content="5;url=<s:url includeParams="all" />"/>
  </head>
  <body>
    Please wait while we process your request.
    Click <a href="<s:url includeParams="all" />">go</a> if this page does not reload automatically.
  </body>
</html>
复制代码

文件头,包括了自动跳转。跳转的地址url我看了一下,是我定义的somecation的url。 includeParams="all" 表示同时提交get和post的参数。在这里就是somecation的参数

 

posted on   meetcomet  阅读(712)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示