9 built in JSP large object type

Nine built-in JSP object:

REQUEST request object type Scope Request javax.servlet.ServletRequest

response in response to the type of object Page scope javax.servlet.SrvletResponse

pageContext page context object type javax.servlet.jsp.PageContext scope Page

session session object type javax.servlet.http.HttpSession scope Session

application application object type javax.servlet.ServletContext Scope Application

the type of output object out of scope Page javax.servlet.jsp.JspWriter

config configuration object types javax.servlet.ServletConfig scope Page

page page object type javax.lang.Object scope Page

exception exception object type javax.lang.Throwable Scope page  

What is JSP nine built-in objects
to create objects 9 can be used without the JSP, which is:
OUT (the JspWriter): equivalent to response.getWriter (), used to send text data to the client;
config (the ServletConfig): corresponds to the "Mami" in the ServletConfig;
page (current JSP real body types): current JSP pages of "this", that is, the current object;
pageContext (pageContext): page context object, it is the last one did not speak of the domain object;
exception (Throwable): only available in the error page that object;
Request (HttpServletRequest): an object that is HttpServletRequest class;
the Response (HttpServletResponse): That the object HttpServletResponse class;
the Application (ServletContext): That the object ServletContext class;
the session ( HttpSession): That the object HttpSession class, not every JSP page can be used, if set in a JSP page <% @ page session = "false "%>, illustrate the pages can not use the session.

Description of built-in objects nine jsp

1.request Object
     Request message is encapsulated in the client request object, through which to understand the needs of customers, then responds. It is an instance of class HttpServletRequest.

2.response target
     response object contains information about responding to customer requests, but rarely use it directly in the JSP. It is an instance of class HttpServletResponse.

Object 3.session
     session object refers to a conversation with the server to the client, the client from a server connected to the WebApplication start until the client disconnects from the server date. It is an instance of class HttpSession.

4.out objects
     out JspWriter Objects are instances of the class, the output content to the client is commonly used objects

5.page target
     page object is a pointer to the current JSP page itself, a bit like the this pointer class, an instance of the class java.lang.Object

6.application target
     application object implements the sharing of data between users, you can store global variables. It begins to start the server until the server is shut down in the meantime, the object will always exist; before and after such connection or a user connection between different users in the same attribute of this object can be operated; anywhere this operation object properties, will affect other users of this access. Server startup and shutdown determine the life application object. It is an instance of class ServletContext.

7.exception target
   exception object is an exception object, when a page exception occurs during operation, it creates the object. If a JSP page you want to apply for this object, it must take isErrorPage set to true, otherwise it is impossible to compile. He is actually an object java.lang.Throwable

8.pageContext objects
pageContext object provides access to all of the objects and the space within the JSP page name, that he has access to the page where the SESSION, can also take the value of a property where the application of this page, he was quite on page all the features of a master, it's the name of this class, also known as pageContext.

9.config objects
config object is initialized when a Servlet, JSP engine information transmitted to it, this information is included Servlet initialization parameters to use (by attribute name and attribute value), and information about the server (by passing a ServletContext object)

Guess you like

Origin www.cnblogs.com/dabrk/p/11124513.html