如果 ViewExpiredException 抛出 jsf 2.0 则恢复会话
情况是。 如果抛出 ViewExpiredException,我想恢复之前的会话,而不是重定向到另一个/登录页面。有什么办法可以做到这一点吗?
the situation is.
if the ViewExpiredException thrown,instead of redirect to another/login page,i want to restore its session before.is there any way to do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,那不可能。已经完全消失在黑洞之中了。这正是抛出此异常的原因。
然而,您可以阻止它的发生。例如,您可以在视图端引入一些简单的 Ajax 轮询器,以使会话在服务器端保持活动状态。您可以在以下答案中找到示例: 在 JSF 中防止长时间处理期间会话超时
No, that's not possible. It's already completely lost in the black hole. That's exactly why this exception is been thrown.
You can however just prevent it from happening. You could for example introduce some simple Ajax poller in the view side to keep the session alive at the server side. You can find an example in the following answer: Preventing session timeout during long processing time in JSF