Home >Common Problem >What are the built-in objects and functions of jsp?
This article mainly introduces jsp objects and functions to you. I hope it will be helpful to friends in need!
JSP has a total of 9 built-in objects:
request
Client request, this request will Contains parameters from GET/POST requests;
response
The response from the web page returned to the client;
pageContext
The properties of the web page are managed here;
session
The session related to the request;
application servlet
The content being executed;
out
Output used to transmit responses;
Architectural components of config servlet
;
page JSP
The web page itself;
exception
Uncaught exception for error web pages.
Function:
Page
refers to the object that JSP is translated into Servlet
Reference.
pageContext
object can be used to obtain other 8 built-in objects, and can also be used as a JSP domain scope object. The value stored in .pageContext
is the current one. Scope of the page》
request
represents the request object, which can be used to obtain client information or can be used as a domain object. Use request
to save it. The data is valid within the scope of a request.
Session
represents a session, which can be used to save the user's private information or as a domain object. The data saved using session
is stored in a session. The scope is valid
Application:
represents the entire application scope. The data saved using this object is valid in the entire web
application.
Response
is the response object, which represents the response data from the server to the browser.
Out:JSPWriter
is used to output content to the page The object
Config:
refers to ServletConfig
which is used to obtain the configuration of Servlet
after JSP is translated into Servlet
Object.
Exception
: Set isErrorPage="true"
in the page, and it can be used. It is a reference to Throwable
. Used to obtain Page error message.
Related recommendations: "JSP Tutorial"
The above is the detailed content of What are the built-in objects and functions of jsp?. For more information, please follow other related articles on the PHP Chinese website!