[英]Redirecting to login when session timeout in JSF/Spring or automatic logout when session deactivate(or idel for a given time)
I have a J2EE application which uses JSF and Spring 3.x. 我有一个使用JSF和Spring 3.x的J2EE应用程序。 My web app is developed in *.xhtml, and I have used JSF ManagedBeans.
我的Web应用程序是使用* .xhtml开发的,并且我使用了JSF ManagedBeans。 I want to redirect to login page when the session has elapsed the timeoout.
我想在会话超时后重定向到登录页面。 I am bit new and need to know the following.
我有点新,需要了解以下内容。
Hope the requirement is clear. 希望要求明确。 Just stating the requirements of my problem again
只是再次说明我的问题的要求
Tech Stack JSF with ManagedBeans(Have used face-config.xml etc..) Spring for the service layer Hibernate for the DAO layer and in defining the entities. 带有ManagedBeans的Tech Stack JSF(已使用face-config.xml等。)Spring用于服务层Hibernate用于DAO层并用于定义实体。
If by "idle" you mean not sending any request to the server then you have to set the session-timeout
in your web.xml
file. 如果通过“ idle”表示不向服务器发送任何请求,则必须在
web.xml
文件中设置session-timeout
。 It should look like this for a 30 minutes timeout : 30分钟的超时时间应如下所示:
<session-config>
<session-timeout>30</session-timeout>
</session-config>
To handle the redirection to login when the session timeout have a look at this answer . 要在会话超时时处理重定向登录,请查看此答案 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.