在web.xml中

 

<session-config> 

<session-timeout>15</session-timeout> 

</session-config> 

这里的15也就是15分钟失效. 

 

 

controller中:

request.getSession().setAttribute("u", username);

 

 

jsp:

<%

 String name = (String)session.getAttribute("u"); 

 %>

 

<input type="hidden" />

 

js:

 var login_name=$("#login_name").val();

 if(login_name=="apm_test"){

  $("#fksh").hide();

  $("#cxsj").hide();

  $("#hysj").hide();

  $("#xptlr").hide();

  $("#gzhy").hide();

  $("#fksh").hide();

 }

 if(login_name=="null"&&login_name!=undefined){

  window.location.href="index.jsp"; 

 }

相关文章:

  • 2021-06-06
  • 2022-12-23
  • 2021-12-17
  • 2021-09-08
  • 2022-12-23
  • 2021-06-30
  • 2022-12-23
  • 2021-06-30
猜你喜欢
  • 2021-07-08
  • 2022-12-23
  • 2022-01-01
  • 2022-12-23
  • 2021-10-15
  • 2022-12-23
相关资源
相似解决方案