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 2013-11-13 15:10  meetcomet  阅读(717)  评论(0)    收藏  举报