java – 在JSP页面中获取maxInactiveInterval值
发布时间:2020-12-15 04:11:51 所属栏目:Java 来源:网络整理
导读:我正在尝试在会话有timedout时刷新页面.我将此添加到我的 head HTML部分: meta http-equiv="refresh" content="${sessionScope['maxInactiveInterval']};url=${pageContext.servletContext.contextPath}/index.htm?reason=expired"/ 但是这样:${sessionSco
我正在尝试在会话有timedout时刷新页面.我将此添加到我的< head>
HTML部分:
<meta http-equiv="refresh" content="${sessionScope['maxInactiveInterval']};url=${pageContext.servletContext.contextPath}/index.htm?reason=expired"/> 但是这样:${sessionScope [‘maxInactiveInterval’]}或${sessionScope.maxInactiveInterval}打印出空值(无). 我知道在JSF中我可以使用:#{session.maxInactiveInterval}并且它可以工作.如何在JSP页面中进行此操作? 解决方法
下面的行将为您提供maxInactiveInterval
${pageContext.session.maxInactiveInterval} 因为sessionScope只将会话范围的变量名称映射到它们的值, 你可以在Official Documentation找到这个. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |