?? get_cookie.jsp
字號:
<%@ page contentType="text/html; charset=gb2312" language="java" %>
<!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=gb2312">
<title>獲取Cookie值</title>
</head>
<body>
<div align="center">
<h2 align="center">獲取Cookie值實(shí)例</h2>
<p>Cookie中的值如下:</p>
<table border=1 cellpadding="0" cellspacing="0" width="350">
<tr>
<th align="center" height="25">名稱</td>
<th align="center" height="25">值</td>
</tr>
<%
Cookie cookies[]=request.getCookies();
Cookie sCookie=null;
String sValue=null;
String sName=null;
for(int i=0;i<cookies.length;i++)
{
sCookie=cookies[i];
sValue=sCookie.getValue();
sName=sCookie.getName();
%>
<tr>
<td height="25" align="left"><%=sName%></td>
<td height="25" align="left"><%=sValue%></td>
</tr>
<%
}
%>
</table>
</div>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -