Java – get the maxinactivitinterval value in the JSP page

I'm trying to refresh the page when the session has timedout I added this to my < head > HTML section:

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

But like this: ${sessionscope ['maxinactivation ']} or ${sessionscope. Maxinactivation} prints a null value (none)

I know that in JSF I can use: #{session. Maxinactivitinterval} and it works How do I do this in a JSP page?

Solution

The following line will provide you with maxinactivitinterval

${pageContext.session.maxInactiveInterval}

Because sessionscope only maps the variable names of the session scope to their values, pagecontext Session provides the client with the location of the session object

You can find this in official documentation

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>