如题,怎么做啊

解决方案 »

  1.   

    <%
        if(request.getSession()==null){
           response.sendRedirect("login.html");
         
    }else{
            
        }%>
        
      

  2.   

    javascript:
    location.href="要去的地址";
      

  3.   

    判断session超时,就是session==null吗?
      

  4.   


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%@ page language="java" contentType="text/html; charset=GBK" %><html>
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=GBK" />
      <title></title>
    </head>
    <body>
    <jsp:forward page="/pages/index.html"/>
    </body>
    </html>
      

  5.   

    不好意思,看错了,应该是这样的。或者   LoginModel loginModel = (LoginModel) session.getAttribute("CURRUSER");
       if(session.getAttribute("CURRUSER") == null) {
                // session中没有登陆信息或登陆超时
                request.setAttribute("info", "请以管理员身份登录!");
                String  url = "/pages/adminlogin.jsp";
                request.getRequestDispatcher(url).forward(request, response);
                return;
       }