当前位置:网站首页>JSP pagecontext对象的简介说明
JSP pagecontext对象的简介说明
2022-07-31 08:23:00 【qq_25073223】
转自:
下文笔者将讲述pagecontext对象的简介说明,如下所示:
pageContext对象的简介: pageContext对象是javax.servlet.jsp.PageContext类的实例对象 pageContext对象指整个JSP页面 pageContext对象指页面上下文 该对象主要用于访问 JSP 之间的共享数据 使用pageContext可以访问page、request、session、application范围的变量
获取pageContext实例的方法
pageContext对象: 使用JspFactory.getPageContext方法即可返回一个pageContext对象
pageContext实例的常用方法
| JspWriter getOut(); | 返回当前客户端响应被使用的JspWriter流(out) |
| HttpSession getSession(); | 返回当前页面中HttpSession对象(session) |
| Object getPage(); | 返回当前页面的Object对象(Object) |
| ServeletRequest getRequest(); | 返回当前页面的ServletRequest对象(request) |
| ServeletResponse getResponse(); | 返回当前页面的ServletResponse对象(response) |
| void setAttribute(String name,Object attribute); | 设置属性及属性值 |
| void getAttribute(String name,int scope); | 在指定范围内取属性的值 |
| int getAttributeScope(String name); | 返回某属性的作用范围 |
| void forward(String relativeUrlPath); | 使当前页面重导到另一页面 |
| void include(String relativeUrlPath); | 在当前位置包含另一文件 |
边栏推荐
猜你喜欢
随机推荐
2019 NeurIPS | Graph Convolutional Policy Network for Goal-Directed Molecular Graph Generation
@RequestBody和@RequestParam区别
普通函数的参数校验
SSM integration case study (detailed)
【Unity】编辑器扩展-04-拓展Scene视图
使用PageHelper实现分页查询(详细)
MySQL 5.7 安装教程(全步骤、保姆级教程)
全国中职网络安全B模块之国赛题远程代码执行渗透测试 PHPstudy的后门漏洞分析
高并发-高可用-高性能
【MySQL功法】第5话 · SQL单表查询
SQL连接表(内连接、左连接、右连接、交叉连接、全外连接)
[Cloud native] Introduction and use of Feign of microservices
Modular specifications
Which strings will be parsed as null by FastJson?
[MySQL exercises] Chapter 4 · Explore operators in MySQL with kiko
蚂蚁核心科技产品亮相数字中国建设峰会 持续助力企业数字化转型
The torch distributed training
【小程序项目开发-- 京东商城】uni-app之自定义搜索组件(中)-- 搜索建议
WLAN部署(AC+AP)配置及常见问题记录
Spark 在 Yarn 上运行 Spark 应用程序









