jsp四大作用域之page
2024-08-24 00:04:36
<%@ 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>
<%
// 设置两个page范围的数据 key-> value
pageContext.setAttribute("name","page王二小");
pageContext.setAttribute("age",12);
%>
<%
// 取值
String name=(String)pageContext.getAttribute("name");
int age=(Integer)pageContext.getAttribute("age");
%>
<font>姓名:<%=name %></font>
<font>年龄:<%=age %></font>
</body>
</html>
最新文章
- HttpURLConnection使用getInputStream无法执行
- 贪心 Codeforces Round #289 (Div. 2, ACM ICPC Rules) B. Painting Pebbles
- 基于DDD的.NET开发框架 - ABP初探
- django admin site (三)
- JavaNIO之Channel
- Linux如何实现开机启动程序详解
- 【LeetCode】 String中的最长回文
- CentOS 在同一窗口打开文件夹
- php 设计模式系列(一)
- Android JNI so库的开发
- java序列化浅谈
- CentOS_关机与重启命令详解
- Linux-Jenkins安装部署
- vue_drf之实现极验滑动验证码
- 【Linux基础】awk命令
- Java(C#)基础差异-语法
- Implementing the On Item Checked Event for the TListView Control
- docker集群部署
- :Windows下RabbitMQ安装及入门
- JavaScript的DOM_StyleSheet操作内联或链接样式表
热门文章
- 【240】◀▶IEW-Unit05
- CodeForces 1109F. Sasha and Algorithm of Silence&#39;s Sounds
- Umbraco image中使用Crop URL
- The web.config file for this project is missing the required DirectRequestModule.
- 洛谷P1349 广义斐波那契数列(矩阵快速幂)
- rest framework 认证
- CRC原理总结
- win10怎样彻底关闭windows Defender
- Each record in table should have a unique `key` prop,or set `rowKey` to an unique primary key.
- 315. Count of Smaller Numbers After Self(Fenwick Tree)