EL表达式的隐含(内置)对象

JSP中的内置对象一共有九个, 由于有的不太常用, 所以总是记不住, 从Sun公司的网站上找到的PDF文档, 把这一部分放在这里, 以备随时查用:
    JSP九个内置对象:
Implicit Objects for Scriptlets
(JSP Scriplets中的隐含对象)
Type
(对应类型)
Scope
(范围)
 Some Useful Methods (see class or interface for others)
(常用的方法)
1requestSubclass of javax.servlet.ServletRequestRequestgetAttribute, getParameter, getParameterNames, getParameterValues, setAttribute
2responseSubclass of javax.servlet.ServletResponsePageNot typically used by JSP page authors
3pageContextjavax.servlet.jsp.PageContextPagefindAttribute, getAttribute, getAttributesScope, getAttributeNamesInScope, setAttribute
4sessionjavax.servlet.http.HttpSessionSessiongetAttribute, getId, setAttribute
5applicationjavax.servlet.ServletContextApplicationgetAttribute, getMimeType, getRealPath, setAttribute
6outjavax.servlet.jsp.JspWriterPageclear, clearBuffer, flush, getBufferSize, getRemaining
7configjavax.servlet.ServletConfigPagegetInitParameter, getInitParameterNames
8pagejava.lang.ObjectPageNot typically used by JSP page authors
9exceptionjava.lang.ThrowablePagegetMessage, getLocalizedMessage, printStackTrace, toString
 
JSP十一个用于EL表达式的隐含(内置)对象:
Implicit Objects for EL
Expressions
用于EL表达式的隐含对象
Type
类型
Description
具体说明
pageContextjavax.servlet.jsp.PageContextThe context for the JSP page. Provides access to various objects, including servletContext, session, request, and response.
pageScopejava.util.MapMaps page-scoped variable names to their values.
requestScopejava.util.MapMaps request-scoped variable names to their values.
sessionScopejava.util.MapMaps session-scoped variable names to their values.
applicationScopejava.util.MapMaps application-scoped variable names to their values.
paramjava.util.MapMaps a request parameter to a single String parameter value (obtained by calling ServletReqwuest.getParameter(String name)).
paramValuesjava.util.MapMaps a request parameter name to an array of String values for that parameter name (obtained by calling ServletRequest.getParameterValues(String name)).
headerjava.util.MapMaps a request header name to a single String header value (obtained by calling ServletRequest.getHeader(String name)).
headerValuesjava.util.MapMaps a request header name to an array of String values for that header (obtained by calling ServletRequest.getHeaders(String)).
coookiejava.util.MapMaps a cookie name to a single Cookie object. Cookies are retrieved according to the semantics of HttpServletRequest.getCookies(). If the same name is shared by multiple cookies, an implementation must use the first one encountered in the array of Cookie objects returned by the getCookies() method. However, the ordering of cookies is currently unsspecified in the Servlet specification.
initParamjava.util.MapMaps a context initialization parameter name to a String parameter value (obtained by calling ServletContext.getInitparameter(String name)).


转载于:https://my.oschina.net/rareliu/blog/16473

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值