UserLogin.jsp
资源名称:Shopping.rar [点击查看]
上传用户:lsj999sz
上传日期:2022-06-15
资源大小:4717k
文件大小:1k
源码类别:
ICQ/即时通讯
开发平台:
Java
- <%@ page language="java" contentType="text/html; charset=GB18030" import="com.bjsxt.shopping.user.*"
- pageEncoding="GB18030"%>
- <%
- String action = request.getParameter("action");
- if(action != null && action.equals("login")) {
- String username = request.getParameter("username");
- String password = request.getParameter("password");
- User u = null;
- try {
- u = User.check(username, password);
- } catch (UserNotFoundException e) {
- out.println(e.getMessage());
- return;
- } catch (PasswordNotCorrectException e) {
- out.println(e.getMessage());
- return;
- }
- session.setAttribute("user", u);
- response.sendRedirect("Confirm.jsp");
- }
- %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=GB18030">
- <title>Insert title here</title>
- </head>
- <body>
- <form action="UserLogin.jsp" method="post">
- <input type="hidden" name="action" value="login"/>
- <table border="1" align="center">
- <tr>
- <td>username:</td>
- <td><input type="text" size="10" name="username"/></td>
- </tr>
- <tr>
- <td>password:</td>
- <td><input type="password" size="10" name="password"/></td>
- </tr>
- <tr>
- <td></td>
- <td><input type="submit" value="login"/><input type="reset" value="reset"/></td>
- </tr>
- </table>
- </form>
- </body>
- </html>