接上
作者:互联网
boolean canLogin =userbiz.checkLogin(username,password);
if(canLogin){
req.getSession().setAttribute("loginuser",username);
req.sendRedirect("main.jsp");
}
检测是否登陆
<%
String username=(String) session.getAttribute("loginuser");
if(username==null){
response.sendRedirect("login.jsp");
}
%>
标签:username,String,接上,sendRedirect,req,jsp,loginuser 来源: https://blog.csdn.net/f1605089018/article/details/88382422