1. For example, to obtain the value of the username attribute stored in the session, you can use the following methods:
Session. getattribute ("username") gets the value of username,
Use the following method in El:
$ {Sessionscope. Username}
2. For example, we can use the following methods to obtain user request parameters:
Request. getparameter (string name)
Request. getparametervalues (string name)
In El, you can use PARAM and paramvalues to obtain data.
$ {Param. name}
$ {Paramvalues. name}
3. For example, to obtain a value named usercountry in a cookie, you can use $ {cookie. usercountry} to obtain it.
4. For example, initparam obtains the environment parameter set for the web site (context)
String userid = (string) application. getinitparameter ("userid ");
You can use $ {initparam. userid} to obtain the userid name.
5. pagecontext obtains details about other 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} obtains 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.