qq_独行者Night_0
2017-06-18 21:37
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<%@ page import="java.net.*" %>
<!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=utf-8">
<title>Insert title here</title>
</head>
<body>
<%
request.setCharacterEncoding("utf-8");
String username="";
String password="";
Cookie[] cookies=request.getCookies();
if(cookies!=null&&cookies.length>0){
for(Cookie c:cookies){
if(c.getName().equals("username")){
username=URLDecoder.decode(c.getValue(),"utf-8");
}
if(c.getName().equals("password")){
password=c.getValue();password=URLDecoder.decode(c.getValue(),"utf-8");
}
}
}
%>
<form action="loginOn.jsp" method="post" name="form">
<table>
<tr>
<td>User:
</td>
<td><input name="username" type="text" value="<%=username %>>" />
</td>
</tr>
<tr>
<td>Password:
</td>
<td><input name="password" type="password" value="<%=password %>>" />
</td>
</tr>
<tr>
<td colspan="2" ><input name="isUseCookie" type="checkbox" />是否保存账号信息
</td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="登陆"/>
</td>
</tr>
</table>
</form>
</body>
</html>
找出来了!!!手贱加了个>我靠
JAVA遇见HTML——JSP篇
248277 学习 · 3071 问题
相似问题