Jsp9 large built-in objects and scopes
1. el: Get the parameter value $ {param. id} in the url}
2. el built-in objects
PageContext, pagination, requestScope, sessionScope, applicationScope, param, paramValues, header, headerValues, cookie, initParam
3. el built-in Object Classification
3.1 implied objects related to the scope: pagination, requestScope, sessionScope, and applicationScope
A. built-in objects equivalent to jsp: pageContext, request, session, and application
B. Value Options: <% = session. getAttribute ("usename"); % >/$ {sessionScope. username}
3.2 hidden objects related to input: param and paramValues
Value Options: <% = request. getParamter ("username"); % >/$ {param. name}/$ {paramValues. username}
3.3. Other implied objects
A. cookie: $ {cookie. username}
B. header and headerValues: data used for communication between the user's browser and the server
C. initParam: Obtain the environment parameter (Context) of the website)
String userid = (String) application. getInitParameter ("userid");/$ {initParam. userid}
D. pageContext: obtain detailed information about user requirements or pages.
$ {PageContext. request. queryString} gets the request parameter string
$ {PageContext. request. requestURL} retrieves the request URL, excluding the request parameter string
$ {PageContext. request. contextPath} indicates the name of the web application of the service.
$ {PageContext. request. method} GET the HTTP method (GET, POST)
$ {PageContext. request. protocol} gets the used protocol (HTTP/1.1, HTTP/1.0)
$ {PageContext. request. remoteUser} obtains the user name
$ {PageContext. request. remoteAddr} gets the user's IP address
$ {PageContext. session. new} checks whether the session is new.
$ {PageContext. session. id} obtains the session ID.
$ {PageContext. servletContext. serverInfo} obtains the service information of the host.
4. JSP built-in object type ing table:
Object Name type Scope
Request javax. servlet. ServletRequest RequestScope
Response javax. servlet. ServletResponse pagination
PageContext javax. servlet. jsp. PageContext pagination
Session javax. servlet. http. HttpSession SessionScope
Application javax. servlet. ServletContext ApplicationScope
Out javax. servlet. jsp. JspWriter pagination
Config javax. servlet. ServletConfig pagination
Page java. lang. Object pagination
Exception javax. lang. Throwable pagination
5. pageContext
This object is special. It can be seen from its type that it is unique to jsp. servlet does not have this object. The pageContext object provides access to all objects and namespaces on the JSP page,
That is to say, he can access the session where this page is located, or take a property value of the application where this page is located, which is equivalent to all functions of the page.