PageContext研究


javax.servlet.jsp.PageContext
          
A PageContext instance provides access to all the namespaces associated with a JSP page, provides access to several page attributes, as well as a layer above the implementation details. Implicit objects are added the pageContext automatically.
          pageContext提供了jsp相关所有的名称空间,提供了访问页面属性,复杂对象也被自动添加到其中。其包含了jsp的所有信息。
          使用pageContext所设定的属性,其作用范围仅限于同一个jsp页面,
          使用request(在同一个request处理期间,包括forward给其他jsp页面)
          使用session(同一个进程作用期间)
          使用application(整个web应用中的jsp均可使用)


Exception getException( ) 回传目前网页的异常,不过此网页要为error page,
JspWriter getOut( ) 回传目前网页的输出流,例如:out
Object getPage( ) 回传目前网页的Servlet 实体(instance),例如:page
ServletRequest getRequest( ) 回传目前网页的请求,例如:request
ServletResponse getResponse( ) 回传目前网页的响应,例如:response
ServletConfig getServletConfig( ) 回传目前此网页的ServletConfig 对象,例如:config
ServletContext getServletContext( ) 回传目前此网页的执行环境(context),例如:application
HttpSession getSession( ) 回传和目前网页有联系的会话(session),例如:session

一般在jsp标签中使用的较多,例如:
pageContext.getOut().write(aHTML.toString());
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值