第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

一直找不到錯(cuò)誤,我是eclipse寫的

<%@page?import="java.util.*,java.net.*"%>

<%@?page?language="java"?contentType="text/html;?charset=UTF-8"?
????pageEncoding="UTF-8"%>
<!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>
<h1>用戶登錄</h1>
<%
	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?=URLDecoder.decode(c.getValue(),?"utf-8");
????????????}
?????????}
????}
%>
?<form?action="dologin.jsp"?name="login"?method="post">
<table>
	<tr>
	<td>姓名:</td>
	<td><input?type="text"?name="username?"?value="<%=username?%>"?/></td>
	</tr>
	<tr>
	<td>密碼:</td>
	<td>
		<input?type="password"?name="password"?value="<%=password?%>"?/>
	</td>
	</tr>
	<tr>
	<td?colspan="2"?><input?type="checkbox"?name="useCookie"?checked?>十天內(nèi)免登陸</td>
	</tr>
	<tr>
	<td?colspan="2"?><input?type="submit"?value="提交"?></td>
	</tr>
</table>

</form>
<br>
<br>


</body>
</html>

這是log.jsp

<%@page?import="java.util.*,java.net.*"%>

<%@?page?language="java"?contentType="text/html;?charset=UTF-8"
????pageEncoding="UTF-8"%>
<!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>
<h1>登錄成功</h1>
<hr>
<%
	request.setCharacterEncoding("utf-8");
	//判斷用戶是否選擇記住密碼
	String[]?useCookie=request.getParameterValues("useCookie");
	if(useCookie!=null&&useCookie.length>0){
		//用戶名和密碼保存在cookie里
		String?username?=?URLEncoder.encode(request.getParameter("username"),"utf-8");
		//使用URLEncoder解決無法在Cookie當(dāng)中保存中文字符串問題
		String?password=URLEncoder.encode(request.getParameter("password"),?"utf-8");
		
		Cookie?usernameCookie=new?Cookie("username",username);
		Cookie?passwordCookie=new?Cookie("password",password);
		
		usernameCookie.setMaxAge(864000);
		passwordCookie.setMaxAge(864000);//最大生存期限10天
		response.addCookie(usernameCookie);
		response.addCookie(passwordCookie);
		
	}else{
		Cookie[]?cookies=request.getCookies();
		if(cookies!=null&&cookies.length>0){
			for(Cookie?c:cookies){
				if(c.getName().equals("username")||c.getName().equals("password")){
					c.setMaxAge(0);//設(shè)置cookie失效
					response.addCookie(c);//重新保存
				}
			}
			
		}
	}

%>

<a?href="users.jsp"?target="_blank">查看用戶信息</a>
</body>
</html>

這是dologin.jsp

<%@page?import="java.util.*,java.net.*"%>

<%@?page?language="java"?contentType="text/html;?charset=UTF-8"
????pageEncoding="UTF-8"%>
<!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>
<h1>用戶信息</h1>
<br>
<%
	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=URLDecoder.decode(c.getValue(),?"utf-8");
			}
		}
		
	}
%>
用戶名:<%=username?%><br>
密碼:<%=password?%><br>

</body>
</html>

這是users.jsp


正在回答

2 回答

題主,是eclipse報(bào)錯(cuò),還是運(yùn)行的時(shí)候報(bào)錯(cuò),希望分享一下報(bào)錯(cuò)的截圖

0 回復(fù) 有任何疑惑可以回復(fù)我~

初步看代碼是沒有問題的,你同學(xué),你先說你遇到的是什么問題吧

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

linhbo

代碼第一行一眼就看到了,那個(gè)引入jar包用。*什么鬼東西
2017-12-26 回復(fù) 有任何疑惑可以回復(fù)我~
#2

ERPPASSPASS 回復(fù) linhbo

這里應(yīng)該是對(duì)的吧,表示所有的類
2018-01-14 回復(fù) 有任何疑惑可以回復(fù)我~
#3

linhbo 回復(fù) ERPPASSPASS

第一次看到的代碼是經(jīng)過中文編譯的,現(xiàn)在看到的是好的,他也沒說他遇到什么錯(cuò)
2018-03-01 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

一直找不到錯(cuò)誤,我是eclipse寫的

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)