登录页面
Created by IntelliJ IDEA.
User: hp
Date: 2016/11/29
Time: 18:38
To change this template use File | Settings | File Templates.
--%>
登录用户名:
密码:
- 逻辑处理页面
Created by IntelliJ IDEA.
User: hp
Date: 2016/11/29
Time: 18:56
To change this template use File | Settings | File Templates.
--%>
String username = request.getParameter("username");
String pwd = request.getParameter("pwd");
if (username.equals("admin")&&pwd.equals("admin")){
session.setAttribute("username", username);
session.setAttribute("pwd", pwd);
request.getRequestDispatcher("login-success.jsp").forward(request,response);
}else {
response.sendRedirect("login-failure.jsp");
}
%>
- 登录成功页面
Created by IntelliJ IDEA.
User: hp
Date: 2016/11/29
Time: 18:43
To change this template use File | Settings | File Templates.
--%>
Title登陆成功
String username = "";
String pwd = "";
if (session.getAttribute("username") != null){
username=session.getAttribute("username").toString();
}
if (session.getAttribute("pwd")!=null){
pwd = session.getAttribute("pwd").toString();
}
%>
用户名:
密码:
- 登录失败页面
Created by IntelliJ IDEA.
User: hp
Date: 2016/11/29
Time: 18:44
To change this template use File | Settings | File Templates.
--%>
Title