Java Web built-in objects and Java Web built-in objects
Jsp built-in objects are a set of objects created by web containers.
The name of the jsp built-in object is a reserved word of jsp.
Jsp built-in objects are objects that can be used directly on the jsp page. You do not need to use new to obtain instances.
Nine built-in jsp objects
1. request
2. response
3. pageContext
4. session
5. application
6. out
7. config
8. page
9. exception
The request object is mainly used to process client requests.
The corresponding method provided by the request object can process the parameters of the http request submitted by the client browser.
Common request object Methods
String getParameter (String name) obtains Page Submission data based on the page form component name
String [] getParameterValues (String name) obtains the user request data when a page form component corresponds to multiple values.
Void setCharacterEncoding (String charset) specifies the encoding of each request. It is set before getParameter () is called to solve Chinese garbled characters.
String getRemoteAddr () returns the IP address of the client that submitted the request.
The setCharacterEncoding method can only be used to handle Chinese garbled characters submitted in post mode, and the setCharacterEncoding method must be placed before all getParameter methods, otherwise garbled characters will still appear.