解决服务推的seeion超时的办法

就是在session超时,发送有错误的javascript的代码,

如:

public  static String ShowObj(String s){
  String str="<!doctype html public \"-//w3c//dtd html 4.0 transitional//en\">" +
    "<html><head><script type=\"text/javascript\">"+s+
    "</script></head><body></body></html>"; 
  
  return str;
 }

if(null==session){
 

 HttpServletResponse response = event.getHttpServletResponse();
   response.setCharacterEncoding("utf-8");
   //response.getWriter().print("no");
   response.getWriter().println(SysMsg.ShowObj("no"));
   response.getWriter().flush();
   response.getWriter().close();
   
   return;

}

猜你喜欢

转载自lspgdut.iteye.com/blog/1072181