Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
会话跟踪,但使用jsp和servlet使用当前用户id登录页面_Jsp_Session_Servlets - Fatal编程技术网

会话跟踪,但使用jsp和servlet使用当前用户id登录页面

会话跟踪,但使用jsp和servlet使用当前用户id登录页面,jsp,session,servlets,Jsp,Session,Servlets,注销页面后,页面被重定向到具有登录用户id的登录页面,密码已被清除。该程序在jsp中通过servlet和kill session实现。如果单击注销按钮,该操作将转到特定servlet并转发到登录页面,则使用此代码执行注销操作一次。如果这有帮助,你可以用这个 public class Logout extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse res

注销页面后,页面被重定向到具有登录用户id的登录页面,密码已被清除。该程序在jsp中通过servlet和kill session实现。如果单击注销按钮,该操作将转到特定servlet并转发到登录页面,则使用此代码执行注销操作一次。如果这有帮助,你可以用这个

public class Logout extends HttpServlet {


    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.getSession().invalidate();
        response.sendRedirect(request.getContextPath() + "/Login.html");
    }

}

大家好,欢迎来到StackOverflow。请花些时间阅读,特别是“我可以在这里问什么话题?”和“我应该避免问什么类型的问题”部分。更重要的是,请阅读。您可能还想了解.并详细解释您的问题我在登录控制器页面中设置了会话属性..比如HttpSession session=request.getSession(true);setAttribute(“userID”,bean.getUserName());终止会话后..我在登录页面的userid文本字段中获取userid