zoukankan      html  css  js  c++  java
  • Struts2学习11--execAndWait拦截器

    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的参数

     

  • 相关阅读:
    对于global的介绍
    elang和python互通的例子
    gen_server的一些心得
    erlang分布式例子
    erlang热部署
    erlang配置三方库
    opencv学习之PyImageSearch
    雅克比矩阵
    罗德里格斯公式的证明
    opencv学习网站
  • 原文地址:https://www.cnblogs.com/meetcomet/p/3421448.html
Copyright © 2011-2022 走看看