To simplify JSP expressions and Code Provides eight automatically Defined variables, sometimes called implicit objects (inherent objects ). They are: request, response, out, session, application, config, pagecontext, and page. Let's take a closer look at them.
Request
The httpservletrequest class is associated with the request, so that you can get the request parameters (through the getparameter method), the request type (get, post, Head, and so on ), and the introduced HTTP header (cookies, Referer, and so on ). Strictly speaking, a request is a subclass of the servletrequest class rather than the httpservletrequest class. In fact, if the request protocol is not HTTP, it will hardly work.
Response
The response of the client is connected to httpservletresponse. Note that because the output stream is buffered, you can set the HTTP status code and Response Header, even though it cannot be sent to the client in standard servlets.
Out
The printwriter class is used to send the data to the client. However, to make the response object valid, you can use a buffer version of The printwrite class jspwriter. By using the session property page ctictive, you can define the buffer size by yourself, or even disable the buffer when the buffer attribute is used. Note that out is only used in scriptlets. Because JSP expressions are automatically put into the output stream, it is seldom necessary to explicitly declare out.
Session
The httpsession class associated with the application and request. Because the session is automatically created, this variable can still be bound even if no introduced session exists. One exception is that, if you use page ctictive to close the session and try to use the session, it will lead to an error (during JSP page conversion to servlet ).
Application
Use the serveletcontext class and get it by using getservletconfig (). getcontext.
Config
Is an object of the servletconfig class.
Pagecontext
This is a new pagecontext class in JSP, used to refine the characteristics of a specific server, such as improving the execution efficiency of jspwriters. If you access through this class rather than directly, your code will still run in the "rule" JSP/servlet engine.
Page
It is not very useful in Java. It is only used to save the time in the script language rather than in Java.