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

     

  • 相关阅读:
    数据切分——Atlas介绍
    HDU 5015 233Matrix (构造矩阵)
    Wincc操作数据库SQLSERVER
    UIWebView 设置背景为透明
    29个你必须知道的Linux命令
    【读书笔记】iOS-UIWindow-WindowLevel
    linux下uart应用编程
    Java Web HelloWorld!
    手把手图文教你eclipse下如何配置tomcat
    Tomcat安装及配置教程
  • 原文地址:https://www.cnblogs.com/meetcomet/p/3421448.html
Copyright © 2011-2022 走看看