Summary of built-in objects
A JSP built-in object is an object that is loaded by a JSP container and can be used directly in a JSP page without declaring it.
nine large built-in objects
1.request: A client request that contains all the request information sent from the browser to the server.
The request object is an instance of the HttpServletRequest interface implementation class. For example: request source, cookie and client request related information. can access data
Common usage: string getparameter (string name) to get a single value from a parameter
String[] Getparametervalue (String name) to get a set of parameter values based on the parameter name
void SetAttribute (String name, Object value) to store data
Object getattribute (String name) gets the stored data by name
2.response: Returns the response of the client.
The response object is an instance of the HttpServletResponse interface implementation class and is responsible for sending the response results to the browser side.
Common usage: void setContentType (String name) to set the type and character encoding of the corresponding content
The void senredirect (String URL) is redirected to the specified URL resource.
3.session: Session object that represents the session state of a session cycle.
The session object is an instance of the implementation class of the HttpSession interface. can access data
4.application: Applies the context object, acting on the entire application.
The Application object is instantiated at the start of the container and destroyed when the container is closed. can access data
5.out: output stream, output data to client.
6.page: Represents the current instance of the page.
7.pageContext: Used to store the current JSP page information. can access data
The configuration information object for the 8.config:jsp page.
9.exception: Exception object for handling error messages in JSP pages.
Note: The four scopes of JSP are pagecontext,request,session,application. If you refresh a page, its pagecontext is always 1, because it accesses the current JSP page, the session access scope is the current conversation, so when the page is refreshed, the count continues to increase, but when a new window opens, a new session is created, so the count starts from 1 The application access scope is the entire application, so the count continues to increase.
Built-in objects for JSPs