struts2攔截器應用wait

登錄頁面,點擊登錄,可以跳轉到一個信息提示頁面,顯示說後臺處理中,請稍候。。。。。。,過了幾秒鐘,刷新頁面,檢測到後臺處理結束,就正常跳轉,沒結束,在等到頁面繼續等待刷新

struts.xml配置:

<constant name="struts.i18n.encoding" value="GBK"></constant>

<package name="test" extends="struts-default" namespace="/">

<action name="login" class="cn.action.LoginAction">

<result name="success" type="dispatcher">/main.jsp

</result>

<result name="error" type="dispatcher">/loginFail.jsp

</result>

<result name="wait">/wait.jsp</result>

<interceptor-ref name="defaultStack"></interceptor-ref>

<interceptor-ref name="execAndWait"></interceptor-ref>

</action>

</package>

wait.jsp等待頁面:

<head>

  <meta http-equiv="refresh" content="2;url=login.action">

  </head>  

  <body>

請稍候,後臺正在處理......

  </body>

注意:2攔截器順序不可亂;刷新頁面url不是wait.jsp

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章