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

     

  • 相关阅读:
    Mybatis3.2和Spring3.x整合----Myb…
    Mybatis3.2和Spring3.x整合----Myb…
    支持向量分类方法
    KKT了解
    机器学习实战笔记 logistic回归
    朴素贝叶斯进行分类
    决策树算法实现
    KNN算法
    Spring AOP中增强知识
    Java动态代理知识
  • 原文地址:https://www.cnblogs.com/meetcomet/p/3421448.html
Copyright © 2011-2022 走看看