1. Common JSP built-in objects
2.out objects
An Out object is an instance of the JspWriter class and is an object commonly used to output content to the client
Number |
Method |
Description |
1 |
void Clear () |
Clears the contents of the buffer |
2 |
void Clearbuffer () |
Clears the current contents of the buffer |
3 |
void Flush () |
Emptying the stream |
4 |
int GetBufferSize () |
Returns the size of the buffer as a number of bytes, or 0 if no buffer is set |
5 |
int getremaining () |
Returns how much of the buffer is remaining available |
6 |
Boolean Isautoflush () |
Automatically empties or throws an exception when the buffer full is returned |
7 |
void Close () |
Turn off the output stream |
8 |
void println () |
To print a string to the client |
The difference between 3.get&post methods
4.request objects
The client's request information is encapsulated in the requests object
It is the ability to understand the needs of the customer and then respond. It is an instance of the HttpServletRequest class.
Number |
Method |
Description |
1 |
Object GetAttribute (String name) |
Returns the property value of the specified property |
2 |
Enumeration Getattributenames () |
Returns an enumeration of all available property names |
3 |
String getcharacterencoding () |
Returns the character encoding method |
4 |
int Getcontentlength () |
Returns the length (in bytes) of the request body |
5 |
String getContentType () |
Get the MIME type of the request body |
6 |
ServletInputStream getInputStream () |
Gets the binary stream of a row in the request body |
7 |
String GetParameter (string name) |
Returns the parameter value of the parameter specified by name |
8 |
Enumeration Getparameternames () |
Returns an enumeration of the available parameter names |
9 |
String[] Getparametervalues (String name) |
Returns an array that contains all the values of the parameter name |
10 |
String Getprotocol () |
Returns the protocol type and version number of the request |
11 |
String Getscheme () |
Returns the name of the plan used for the request, such as HTTP HTTPS and FTP |
12 |
int Getserverport () |
Returns the port number used by the server to accept this request |
13 |
String getServerName () |
Returns the host name of the server that accepted the request |
14 |
BufferedReader Getreader () |
Returns the requested body that has been decoded |
15 |
String getremoteaddr () |
Returns the IP address of the client sending this request |
16 |
String Getremotehost () |
Returns the host name of the client that sent this request |
17 |
void SetAttribute (String key Object obj) |
Setting property values for a property |
18 |
String Getrealpath (String path) |
Returns the true path of a virtual path |
19 |
void Setcharacterencoding ("gb2312") |
Set the character set that accepts parameters |
"Javaweb" Learning note five JSP built-in objects (top)