Request object type
Javax. servlet. servletrequest scope request
Response response object type
Javax. servlet. srvletresponse scope page
Pagecontext Page Context object type
Javax. servlet. jsp. pagecontext scope page
Session Object Type
Javax. servlet. http. httpsession scope session
Application Object Type
Javax. servlet. servletcontext Scope application
Out output object type
Javax. servlet. jsp. jspwriter scope page
Config configuration object type
Javax. servlet. servletconfig scope page
Page Object Type
Javax. Lang. object scope page
Exception exception object type
Javax. Lang. throwable scope page
Built-in Object Classification
Servlet-related built-in objects
◇ Page
◇ Config
Built-in objects related to input/output
◇ Out
◇ Request
◇ Response
Built-in context objects provided during JSP execution
◇ Session
◇ Application
◇ Pagecontext
Error-related objects
◇ Exception
1. Request object
The request object is a javax. servlet. httpservletrequest object. This object represents the client request information and is mainly used to accept data transmitted to the server over HTTP. (Including header information, system information, request method, and request parameters ). The request scope is one request.
2. Response object
Response refers to the response to the client, mainly to pass the objects processed by the JSP Container Back to the client. The response object also has a scope, which is only valid on the JSP page.
3. Session Object: within the range of one session
A session object is a user request-Related Object automatically created by the server. The server generates a session object for each user to save the user's information and track the user's operation status. The Session object uses the map class to save data. Therefore, the format of the stored data is "key/value ". The value of the session object can make complex object types, not limited to string types.
4. Application Object: within the scope of a server application
The application object can save the information on the server until the server is closed. Otherwise, the information saved in the Application object will be valid throughout the application. Compared with the session object, the application object has a longer life cycle, similar to the system's "global variable ".
5. Out object
The out object is used to output information in a Web browser and manage the output buffer on the application server. When you use an out object to output data, you can operate on the data buffer, and immediately clear the residual data in the buffer, giving up the buffer space for other outputs. After the data is output, close the output stream in time.
6. pagecontext object
The pagecontext object is used to obtain parameters of any range. It can be used to obtain out, request, reponse, session, application, and other objects of the JSP page. The creation and initialization of the pagecontext object are completed by the container. You can directly use the pagecontext object on the JSP page.
7. config object
The main function of the config object is to obtain the configuration information of the server. You can use the getservletconfig () method of the pageconext object to obtain a Config object. When a servlet is initialized, the container passes some information to the servlet through the config object. Developers can provide initialization parameters for servlet programs and JSP pages in the application environment in the web. xml file.
8. Page Object
The page object represents the JSP itself and is valid only on the JSP page. The page implicit object essentially contains the variables referenced by the current servlet interface, similar to the this pointer in Java programming.
9. Exception object
The exception object is used to display exception information. It can only be used on pages containing iserrorpage = "true". Using this object on a common JSP page will not compile JSP files. The annotation object is the same as all Java objects and has the inheritance structure provided by the system. The exception object defines almost all exceptions. In Java programs, you can use the try/catch keyword to handle exceptions. If exceptions are not caught on the JSP page, an exception object is generated, and send the exception object to the error page set in the page command, and then process the corresponding
Exception object.