What is a built-in object?
is a set of objects created by the Web container and does not need to be built-in objects that can be used directly with the New keyword.
The nine main built-in objects for JSPs:
Commonly used are: Out object, Request object, Response object, Session object, Application object
Infrequently used are: Page object, PageContext object, exception object, config object.
Out object: Is an instance of the JspWriter class that is responsible for the common objects that output content to the client. Common methods are:
void println () prints a string to the client.
void Clear () clears the buffer contents and throws an exception if used after flush.
void Clearbuffer () clears the contents of the buffer, and the call does not throw an exception after flush.
void Flush () outputs the buffer contents to the client.
int GetBufferSize () returns the size of the number of buffer bytes, or 0 if the buffer is not set.
int getremaining () returns how much of the buffer is left to use.
Boolean Isautoflush () returns whether the buffer is full or empty or throws an exception.
void Close () closes the output stream.
Request object: The user encapsulates the requested information submitted by the client. is an instance of the HttpServletRequest class. Common methods are:
String GetParameter (string name); Returns the parameter value of the parameter specified by name. Read request parameters
String[] Getparametervalues (String name); Returns the data that contains the name. such as multi-box, etc.
void SetAttribute (String,object); Storing properties in a request
Object GetAttribute (String name); Returns the property value of the specified property
String getContentType (); Gets the MIME type of the request body
String Getprotocol (); Returns the protocol type and version number of the request
String getservername (); Returns the host name of the server that accepts the request
void Setcharacterencoding ("Write code here"); Set the encoding method to accept the request//solve the problem of accepting garbled, must use post submission
Java Learning-built-in objects