在JSP页面中获取maxInactiveInterval值

时间:2013-07-04 13:04:49

标签: java jsp el

我正在尝试在会话有timedout时刷新页面。我将其添加到HTML的<head>部分:

<meta http-equiv="refresh"
      content="${sessionScope['maxInactiveInterval']};url=${pageContext.servletContext.contextPath}/index.htm?reason=expired"/>

但是:${sessionScope['maxInactiveInterval']}${sessionScope.maxInactiveInterval}打印出空值(无)。

我知道在JSF中我可以使用:#{session.maxInactiveInterval}并且它可以工作。如何在JSP页面中进行此操作?

1 个答案:

答案 0 :(得分:7)

以下行将为您提供maxInactiveInterval

${pageContext.session.maxInactiveInterval}

因为sessionScope只将会话范围的变量名映射到它们的值, 其中pageContext.session为客户提供会话对象

您可以在Official Documentation

中找到