jsp九大内置对象之pagecontext对象

pageContext对象
   pageContext对象提供了对JSP页面内所有的对象及名字空间的访问,也就是说他可以访问到本页所在的SESSION,也可以取本页面所在的application的某一属性值,他相当于页面中所有功能的集大成者,它的本类名也叫pageContext。
方 法 说 明
1 JspWriter getOut() 返回当前客户端响应被使用的JspWriter流(out)
2 HttpSession getSession() 返回当前页中的HttpSession对象(session)
3 Object getPage() 返回当前页的Object对象(page)
4 ServletRequest getRequest() 返回当前页的ServletRequest对象(request)
5 ServletResponse getResponse() 返回当前页的ServletResponse对象(response)
6 Exception getException() 返回当前页的Exception对象(exception)
7 ServletConfig getServletConfig() 返回当前页的ServletConfig对象(config)
8 ServletContext getServletContext() 返回当前页的ServletContext对象(application)
9 void setAttribute(String name,Object attribute) 设置属性及属性值
10 void setAttribute(String name,Object obj,int scope) 在指定范围内设置属性及属性值
11 public Object getAttribute(String name) 取属性的值
12 Object getAttribute(String name,int scope) 在指定范围内取属性的值
13 public Object findAttribute(String name) 寻找一属性,返回起属性值或NULL
14 void removeAttribute(String name) 删除某属性
15 void removeAttribute(String name,int scope) 在指定范围删除某属性
16 int getAttributeScope(String name) 返回某属性的作用范围
17 Enumeration getAttributeNamesInScope(int scope) 返回指定范围内可用的属性名枚举
18 void release() 释放pageContext所占用的资源
19 void forward(String relativeUrlPath) 使当前页面重导到另一页面
20 void include(String relativeUrlPath) 在当前位置包含另一文件
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值