⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 get_cookie.jsp

📁 jsp动态网站开发技术与实践 电子工业出版社 随书附赠源代码
💻 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值实例</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>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -