【发布时间】:2018-06-05 16:08:12
【问题描述】:
我已经按照here 和here 的描述实现了 ViewExpiredException 处理(感谢@BalusC 和团队)。它工作正常。但是,错误页面闪过得很快,以至于用户没有被告知他/她由于会话超时而被重定向。有没有办法让事情慢一点?
这是错误页面:
<html lang="en">
<head>
<title>Session Expired</title>
<meta http-equiv="refresh" content="0;url=#{request.contextPath}/index.xhtml" />
</head>
<body>
<h1>Session Expired</h1>
<h3>You will be redirected to the starting page</h3>
<p><a href="#{request.contextPath}/index.xhtml">Click here if the redirect didn't work or if you are impatient.</a></p>
</body>
【问题讨论】:
-
我不希望它消失。确定您的错误页面中没有一些 http 元刷新或其他内容?
-
是的,我愿意(我在问题中添加了错误页面)。等待用户点击会更好吗>
-
您在发帖之前不知道/注意到这一点?本来可以节省您创建问题的时间,因为它根本与 jsf 无关(也可以节省我的时间;-))。如果您使用这个普通的 http 服务器错误页面,也会出现同样的问题。最佳解决方案取决于您。添加几秒钟的延迟或等待点击
-
抱歉不完整,Kukeltje。不知何故,我意识到重定向是处理超时异常的正常方法。我不知道如何添加延迟 - 这正是我要问的。我想我应该用 http 或 html 标签发布
-
Uhhhh... 那么请了解
content="0;做了什么... minimal reproducible example... 总是... ;-)