在引入了webwork-default.xml的前提下
xwork.xml 配置 :
1、增加拦截器
<interceptor-ref name="execAndWait">
<!-- 等待时间,执行时间没有超过此值,将不显示等待画面 (毫秒)-->
<param name="delay">1000</param>
<!-- 间隔检查时间,检查后台进程有没有执行完毕,如果完成了它就立刻返回,不用等到等待,用户不会看到等待画面 -->
<param name="delaySleepInterval">50</param>
</interceptor-ref>
此拦截器必须放在所有拦截器的最后。
2、增加result
<result name="wait">wait.jsp</result>
如果没有找到"wait"结果,WebWork会自动生成一个wait结果(\com\opensymphony\webwork\interceptor\wait.ftl).这个结果是用FreeMarker做的,所以需要Freemarker支持才能正常工作。如果你不想在程序中加入FreeMarker,那就必须自己实现一个wait结果。这一般来说是有必要的,因为默认的wait页面很简单。
3、Action实现SessionAware接口
因为这个action将会以单独的线程执行,所以你不能用ActionContext,因为它是ThreadLocal.这也就是说如果你要访问session数据,你必须实现 SessionAware结构而不是调用ActionContext.getSesion() 。
public interface SessionAware{
public void setSession(Map map);
}
public abstract class AbsBasicAction extends ActionSupport implements SessionAware{
/** 当前 Session */
protected Map session ;
public void setSession(Map session) {
this.session = session ;
}
}
4、实现 wait 结果 映射的 wait.jsp
必须设置该页面的meta信息,每隔5秒,重新请求一次前面的action。
<meta http-equiv="refresh" content="5;url="<ww:url includeParams="'all'" />">
分享到:
相关推荐
Oracle中EXECUTE IMMEDIATE用法
EXECUTE
精品技术类ppt模板execute_exe005
Python 使用pyinstaller打包成exe文件后运行出现Failed to execute script ***的解决方案
SSIS Package Deploy Configuration and Timing Execute
Execute runner
connection对象的execute方法
ExecuteSQL.java
failed to execute script 解决方案+命令行执行传参exe
Mastering these features opens the door to query solutions that are more robust, execute faster, and are easier to maintain over time than prior solutions using older techniques. The book: Takes ...
delegate_execute.exe
execute immediate 用法研究 为初学者打造。
Python 3.85 使用pyinstaller在win10 x64下打包的应用程序,在win10 x64下运行完全正常,但是在win7 x64下则报错。failed to execute script pyi_rth_ pyi_rth_xxx 解决方法
尽管DBMS_SQL仍然可用,但是推荐使用EXECUTE IMMEDIATE,因为它获的收益在包之上。 — 使用技巧 1. EXECUTE IMMEDIATE将不会提交一个DML事务执行,应该显式提交 如果通过EXECUTE IMMEDIATE处理DML命令, 那么在完成...
execute_exe
Explorer for MySQL Data Base.You can retrieve and execute your query.
winform Server.Execute! 很值得下载看看!资源免费,大家分享!!
remote_copy_and_execute remote_copy_and_execute是用于将脚本批量复制到主机的已设置列表,一次执行N并打印结果的工具。 它使用SSH协议(ssh和scp实用程序)执行操作。 这对于多种目的很有用, 从运行自定义...
ExecutorService的execute和submit方法
could not execute:bad executable format(win32 error 193) 下了一个实现MD5的代码,编译时没有错误,但是执行的时候却提示:could not execute:bad executable format(win32 error 193)