How to avoid WSOD (blank screen) while loading long-running initialization data in Struts2?(在 Struts2 中加载长时间运行的初始化数据时如何避免 WSOD(空白屏幕)?)
问题描述
我需要做以下事情:
- 用户登录.
- 重定向到欢迎屏幕.
- 在加载大量记录时查看欢迎屏幕.
- 重定向到工作屏幕.
我正在寻找一种在 Action 类中执行以下操作的方法:
I am looking for a way to do in Action class something like this:
public class LinkAction extends ActionSupport implements SessionAware {
@Autowired
private ServiceDelegate myService;
public String welcome()
{
new Runnable() {
@Override
public void run() {
myService.getLoadsOfData();
//redirect to the next action
}
}.run();
// this is where the user
// goes to look at the welcome screen
return "welcome";
}
}
可能这是一个错误的方法,如果是,请告诉我,我是 Struts 的新手.
May be it's a wrong approach, please tell if so, I am new at Struts.
推荐答案
感谢 AJAX 的想法.
Thank you for the AJAX idea.
然而,我正在寻找的答案实际上是 Struts 拦截器execAndWait".我决定在 AJAX 上使用它,因为我正在处理现有的应用程序并且所有的 Struts 管道都已就位.这是 Struts 指南
However, the answer I was looking for was in fact Struts interceptor "execAndWait". I decided to use it over AJAX because I am dealing with existing application and all the Struts plumbing is in place. This is the Struts guide on this
这篇关于在 Struts2 中加载长时间运行的初始化数据时如何避免 WSOD(空白屏幕)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 Struts2 中加载长时间运行的初始化数据时如何避免 WSOD(空白屏幕)?


- 从 finally 块返回时 Java 的奇怪行为 2022-01-01
- Java包名称中单词分隔符的约定是什么? 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
- Jersey REST 客户端:发布多部分数据 2022-01-01
- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01
- Eclipse 插件更新错误日志在哪里? 2022-01-01
- 如何使用WebFilter实现授权头检查 2022-01-01
- C++ 和 Java 进程之间的共享内存 2022-01-01
- 将log4j 1.2配置转换为log4j 2配置 2022-01-01