📄 getcookies.jsp
字号:
<%@ page contentType="text/html;charset=GB2312" language="java" %>
<html>
<head>
<title>获取Cookie的信息</title>
</head>
<body>
<%
Cookie myCookie=new Cookie("Name","ZHT");//建立cookie实例myCookie
Cookie sellBook_Ord=new Cookie("ID","CNZZ060929110");
response.addCookie(myCookie);//保存到客户端
response.addCookie(sellBook_Ord);
Cookie[] AllCookie=request.getCookies();
%><h3>客户端的Cookie信息有</h3>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="1" ID="Table1">
<tr bgcolor="#E6E6E6">
<th height="23">索 引</th>
<th >内 容</th>
</tr>
<%
for(int i=0;i<AllCookie.length;i++){
String cke_index=AllCookie[i].getName();
String cke_value=AllCookie[i].getValue();
%>
<tr align="center" bgcolor="#B1C3D9">
<td><%=cke_index%></td><td><%=cke_value%></td>
</tr> <%}%>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -