String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
My JSP 'login.jsp' starting pageString name=request.getParameter("username");
String pwd=request.getParameter("pwd");
//导入JAVAbean
LoginUserChecked login=new LoginUserChecked();
boolean t=login.checkUser(name, pwd);
if(t)//判断是否有值返回
{//会话信息保存,第三个内置对象的应用
session.setAttribute("logininfo","true");
//第二个内置对象的应用
response.sendRedirect("main.jsp");
}//正确的窗口
else
{ response.sendRedirect("error.jsp");}//错误的窗口
%>
展开