12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>Insert title here</title>
- </head>
- <body>
- <% String msg=(String)request.getAttribute("msg");
- Cookie[] cookies = request.getCookies();
- String cUser = "";
- String cPassword = "";
- if (cookies != null) {
- int x = cookies.length;
- for (int i = 0; i < x; i++) {
- Cookie cookie = cookies[i];
- if ("username".equals(cookie.getName())) {
- cUser = cookie.getValue();
- }
- if ("password".equals(cookie.getName())) {
- cPassword = cookie.getValue();
- }
- }
- }
- %>
- <font color="red"><%=msg==null?"":msg %></font>
- <form action="login_test.jsp" method="post">
- username:<input type="text" name="username" value="<%=cUser%>">
- <p>
- password:<input type="password" name="password"
- value="<%=cPassword%>">
- <p>
- 记住密码: <input type="checkbox" value="1" name="flag">
- <p>
- <a href="Register.jsp">注册</a>
- <p>
- <input type="submit" value="登录">
- <input type="reset" value="清空">
- </form>
- </body>
- </html>
|