struts2 执行等待

(1) <action name="longProcess1" class="org.apache.struts2.showcase.wait.LongProcessAction">
            <interceptor-ref name="defaultStack"/>
            <interceptor-ref name="execAndWait"/>       //必须的拦截器(no delay)
            <result name="wait">wait.jsp</result>    //等待的页面

(在wait.jsp可以添加如下代码检测是否执行完: <meta http-equiv="refresh" content="5;url=<s:url includeParams="all"/>"/>)
            <result name="success">complete.jsp</result>  //成功后的页面
        </action>

------------

(2) <interceptor-ref name="execAndWait"> 

                  <param name="delay">2000</param>  //延迟2秒执行action
                          </interceptor-ref>

(3)<interceptor-ref name="execAndWait"> 

                  <param name="delay">3000</param>  //delay 3 seconds
                <param name="delaySleepInterval">1000</param>   

delaySleepInterval会自动刷新,如果操作执行完就会跳转到成功页面。
            </interceptor-ref>

-----------------------

 

你可能感兴趣的:(apache,jsp)