jsp内置对象*pageContext
2016-02-28 14:01
513 查看
pageContext对象
基本概念:
可以访问和当前页面相关联的所有作用域,及一些页面属性,他相当于页面中所有功能的集大成者
方法说明:
JspWriter getOut() 返回当前客户端响应被使用的JspWriter流(out)
HttpSession getSession() 返回当前页中的HttpSession对象(session)
Object getPage() 返回当前页的Object对象(page)
ServletRequest getRequest() 返回当前页的ServletRequest对象(request)
ServletResponse getResponse() 返回当前页的ServletResponse对象(response)
Exception getException() 返回当前页的Exception对象(exception)
ServletConfig getServletConfig() 返回当前页的ServletConfig对象(config)
ServletContext getServletContext() 返回当前页的ServletContext对象(application)
void setAttribute(String name,Object attribute) 设置属性及属性值
void setAttribute(String name,Object obj,int scope) 在指定范围内设置属性及属性值
public Object getAttribute(String name) 取属性的值
Object getAttribute(String name,int scope) 在指定范围内取属性的值
public Object findAttribute(String name) 寻找一属性,返回起属性值或NULL
void removeAttribute(String name) 删除某属性
void removeAttribute(String name,int scope) 在指定范围删除某属性
int getAttributeScope(String name) 返回某属性的作用范围
Enumeration getAttributeNamesInScope(int scope) 返回指定范围内可用的属性名枚举
void release() 释放pageContext所占用的资源
void forward(String relativeUrlPath) 使当前页面重导到另一页面
void include(String relativeUrlPath) 在当前位置包含另一文件
基本概念:
可以访问和当前页面相关联的所有作用域,及一些页面属性,他相当于页面中所有功能的集大成者
方法说明:
JspWriter getOut() 返回当前客户端响应被使用的JspWriter流(out)
HttpSession getSession() 返回当前页中的HttpSession对象(session)
Object getPage() 返回当前页的Object对象(page)
ServletRequest getRequest() 返回当前页的ServletRequest对象(request)
ServletResponse getResponse() 返回当前页的ServletResponse对象(response)
Exception getException() 返回当前页的Exception对象(exception)
ServletConfig getServletConfig() 返回当前页的ServletConfig对象(config)
ServletContext getServletContext() 返回当前页的ServletContext对象(application)
void setAttribute(String name,Object attribute) 设置属性及属性值
void setAttribute(String name,Object obj,int scope) 在指定范围内设置属性及属性值
public Object getAttribute(String name) 取属性的值
Object getAttribute(String name,int scope) 在指定范围内取属性的值
public Object findAttribute(String name) 寻找一属性,返回起属性值或NULL
void removeAttribute(String name) 删除某属性
void removeAttribute(String name,int scope) 在指定范围删除某属性
int getAttributeScope(String name) 返回某属性的作用范围
Enumeration getAttributeNamesInScope(int scope) 返回指定范围内可用的属性名枚举
void release() 释放pageContext所占用的资源
void forward(String relativeUrlPath) 使当前页面重导到另一页面
void include(String relativeUrlPath) 在当前位置包含另一文件
相关文章推荐
- jsp内置对象*config
- JavaScript--Map和Set介绍
- 【前端】Sublime text3 插件HTML/CSS/JS prettify 格式化代码
- bzoj 1031: [JSOI2007]字符加密Cipher 后缀数组
- 1016: [JSOI2008]最小生成树计数
- JSP—九大隐式对象之pageContext
- 关于sort的使用
- Javascript的数据类型简述
- JS之数组
- jsp入门
- Atom技巧
- bzoj 1029: [JSOI2007]建筑抢修 贪心
- Javascript中的var self = this
- Gson 设定固定的日期格式来生成Gson-------Gson 可以将某个对象转换成json,也可将json转换成对象
- Js事件列表
- 封装json ajax函数
- 妙用javascript:void(0)
- js实现<a>超链接的跳转验证
- 《JavaScript语言精粹》知识点总结(二)
- window 窗口对象 - Javascript语言描述