Request object in jsp

Source: Internet
Author: User

The request object has completed the httpservletrequest interface, deciding that it can obtain Users' Request Parameters, obtain cookies, obtain HTTP request headers, and obtain users' IP addresses. The first essentials of the request object are:

Getparameter (string name) obtains the parameter value sent from the client to the server. This parameter is usually specified by the name attribute of the form.

Getparametervalues (string name) obtains all the values of the parameters sent from the client to the server and goes to a string array.

Getparameternames () obtains the names of all parameters that the client sends to the server. The result is an enumeration instance.

Getheader (string name) obtains the value of an HTTP request header.

Getheaders (string name) obtains all values of an HTTP request header.

Getheadernames () obtains the names of all HTTP request headers.

Getmethod () obtains the central request essentials (get, post ).

Getcookies () Get the cookie Array

Setattribute (string N, object O) configures an attribute and attribute value on the request.

Getattribute (string name) obtains the value of an attribute on the request object.

Removeattribute (string name) deletes an attribute of the request object.

Getattributenames () obtains the values of all attributes on the request object.

Getrequesturl () obtains the URL requested by the client.

Getrequesturi () obtains the URI requested by the client.

Getquerystring () gets the query string, that is, the string appended to the URI when the client decides to pass the get essentials.

Getservername () gets the name of the server.

Getserverport () gets the server port.

Getcontextpath () is used by the web.

Getlocaladdr () obtains the IP address of the server requested by the client.

Getremoteaddr () obtains the IP address of the client.

Getsession ([Boolean create]) goes to the httpsession related to the central request.

Getrequestdispatcher (string path) obtains the requestdispatcher object corresponding to the path.

Setcharacterencoding (string ENC) configures the character set used by the central parameter.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.