免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1324 | 回复: 0
打印 上一主题 下一主题

JSP的内置(隐含)对象及EL表达式的内置(隐含)对象 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-11-22 22:39 |只看该作者 |倒序浏览
    JSP中的内置对象一共有九个, 由于有的不太常用, 所以总是记不住, 从Sun公司的网站上找到的PDF文档, 把这一部分放在这里, 以备随时查用:
    JSP九个内置对象:
Implicit Objects for Scriptlets
(JSP Scriplets中的隐含对象)

Type
(对应类型)

Scope
(范围)

Some Useful Methods (see class or interface for others)
(常用的方法)

1
request
Subclass of javax.servlet.ServletRequest
Request
getAttribute, getParameter, getParameterNames, getParameterValues, setAttribute
2
response
Subclass of javax.servlet.ServletResponse
Page
Not typically used by JSP page authors
3
pageContext
javax.servlet.jsp.PageContext
Page
findAttribute, getAttribute, getAttributesScope, getAttributeNamesInScope, setAttribute
4
session
javax.servlet.http.HttpSession
Session
getAttribute, getId, setAttribute
5
application
javax.servlet.ServletContext
Application
getAttribute, getMimeType, getRealPath, setAttribute
6
out
javax.servlet.jsp.JspWriter
Page
clear, clearBuffer, flush, getBufferSize, getRemaining
7
config
javax.servlet.ServletConfig
Page
getInitParameter, getInitParameterNames
8
page
java.lang.Object
Page
Not typically used by JSP page authors
9
exception
java.lang.Throwable
Page
getMessage, getLocalizedMessage, printStackTrace, toString

JSP十一个用于EL表达式的隐含(内置)对象:
Implicit Objects for EL
Expressions
用于EL表达式的隐含对象

Type
类型

Description
具体说明

pageContext
javax.servlet.jsp.PageContext
The context for the JSP page. Provides access to various objects, including servletContext, session, request, and response.
pageScope
java.util.Map
Maps page-scoped variable names to their values.
requestScope
java.util.Map
Maps request-scoped variable names to their values.
sessionScope
java.util.Map
Maps session-scoped variable names to their values.
applicationScope
java.util.Map
Maps application-scoped variable names to their values.
param
java.util.Map
Maps a request parameter to a single String parameter value (obtained by calling ServletReqwuest.getParameter(String name)).
paramValues
java.util.Map
Maps a request parameter name to an array of String values for that parameter name (obtained by calling ServletRequest.getParameterValues(String name)).
header
java.util.Map
Maps a request header name to a single String header value (obtained by calling ServletRequest.getHeader(String name)).
headerValues
java.util.Map
Maps a request header name to an array of String values for that header (obtained by calling ServletRequest.getHeaders(String)).
coookie
java.util.Map
Maps 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.
initParam
java.util.Map
Maps a context initialization parameter name to a String parameter value (obtained by calling ServletContext.getInitparameter(String name)).


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/15221/showart_1660215.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP