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");
}
%>