内置对象

[size=xx-large][size=x-large]•Application: These objects has an application scope. These objects are available at the widest context level, that allows to share the same information between the JSP page's servlet and any Web components with in the same application.
•Config: These object has a page scope and is an instance of javax.servlet.ServletConfig class. Config object allows to pass the initialization data to a JSP page's servlet. Parameters of this objects can be set in the deployment descriptor (web.xml) inside the element <jsp-file>. The method getInitParameter() is used to access the initialization parameters.
•Exception: This object has a page scope and is an instance of java.lang.Throwable class. This object allows the exception data to be accessed only by designated JSP "error pages."
•Out: This object allows us to access the servlet's output stream and has a page scope. Out object is an instance of javax.servlet.jsp.JspWriter class. It provides the output stream that enable access to the servlet's output stream.
•Page: This object has a page scope and is an instance of the JSP page's servlet class that processes the current request. Page object represents the current page that is used to call the methods defined by the translated servlet class. First type cast the servlet before accessing any method of the servlet through the page.
•Pagecontext: PageContext has a page scope.Pagecontext is the context for the JSP page itself that provides a single API to manage the various scoped attributes. This API is extensively used if we are implementing JSP custom tag handlers. PageContext also provides access to several page attributes like including some static or dynamic resource.
•Request: Request object has a request scope that is used to access the HTTP request data, and also provides a context to associate the request-specific data. Request object implements javax.servlet.ServletRequest interface. It uses the getParameter() method to access the request parameter. The container passes this object to the _jspService() method.
•Response: This object has a page scope that allows direct access to the HTTPServletResponse class object. Response object is an instance of the classes that implements the javax.servlet.ServletResponse class. Container generates to this object and passes to the _jspService() method as a parameter.
•Session: Session object has a session scope that is an instance of javax.servlet.http.HttpSession class. Perhaps it is the most commonly used object to manage the state contexts. This object persist information across multiple user connection.
----------------------------------------------------------------------
request Object is Protocol dependent sub type of javax.servlet.ServletRequest with request scope - A reference to the current request.
response Object is Protocol dependent sub type of javax.servlet.ServletResponse with page scope - The response to the request.
pageContext Object is javax.servlet.jsp.PageContext type with page scope - Provides a common point to access the request, response, session, and application, associated with the page being served.
session Object is javax.servlet.http.HttpSession type with session scope - The session associated with the current request.
application Object is javax.servlet.ServletContext type with application scope - The servlet context to which the page belongs.
out Object is javax.servlet.jsp.JspWriter type with page scope - The object that writes to the response output stream.
config Object is javax.servlet.ServletConfig type with page scope - The servlet configuration for the current page.
Page Object is java.lang.Object type with page scope - An instance of the page implementation class that is serving the request (synonymous with the this keyword if Java is used as the scripting language).
exception Object is java.lang.Throwable type with page scope - Available with JSP pages that act as error pages for other JSP pages.


[/size][/size]

猜你喜欢

转载自wwwjjq.iteye.com/blog/1488793
今日推荐