仅在会话到期后才在登录表单中显示一些文本(JSP页面)

时间:2013-07-24 11:03:50

标签: jsp


我希望在会话过期时在登录表单中打印一些文字,说“会话已过期,再次登录”。我认为这实际上是有效的,但我想知道是否还有另外一种方法可以做到这一点我认为是这样的方式

//when the session expires
response.sendRedirect("login.jsp?param=0");

在login.jsp中我写道:

<% if ( request.getParameter("param") != null ) { %> Session Expired, plz login again<%}%>

这样做很好。有没有其他方法来做到这一点,而不传递网址中的参数?谢谢!

1 个答案:

答案 0 :(得分:0)

另一种方法是使用Spring Security框架 http://static.springsource.org/spring-security/site/index.html