Nine large built-in object!!!

Source: Internet
Author: User

The Request object client requests information to be encapsulated in the requestor object to understand the customer's needs and then respond. It is an instance of the HttpServletRequest Class 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 4 int getcontentlength () returns the length of the request body (in bytes) 5 String getcontenttype () to 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 specified parameter for name 8 enumeration Getparameternames () Returns an enumeration of the available parameter names 9 string[] Getparametervalues (String name) Returns an array of all values that contain the parameter name Response Object Response object contains information about the response to a customer request, but it is seldom used directly in the JSP. It is an instance of the HttpServletResponse class. The response object has a page scope, that is, when a page is accessed, the response object within that page is valid only for this access, and the response object on the other page is not valid for the current page. 1 String getcharacterencoding () returns the response with what character encoding 2 Servletoutputstream Getoutputstream () returns a binary output stream of the response 3 PrintWriter Getwriter () Returns an object that can output characters to the client 4 void setcontentlength (int len) Setting the response header length 5 void setContentType (String type) to set the response MIME type 6 Sendredirect (java.lang.String location) REDIRECT client request Session Object Session object refers to the client-to-server conversation, starting from the client connection to a webapplication of the server Until the client disconnects from the server. It is hAn instance of the Ttpsession class. 1 long GetCreationTime () returns session creation time 2 public String getId () returns the unique ID number that the JSP engine set for the session when it was created 3 long getlastaccessedtime () Returns the last request time of the client in this session 4 int getmaxinactiveinterval () returns two request interval how long this session was canceled (MS) 5 string[] GetValueNames () Returns an array containing all the available properties in this session 6 void invalidate () cancels the session, making session unavailable 7 Boolean isnew () returns a session created by the server, whether the client has joined 8 void RemoveValue (String name) removes the attribute specified in the session out object is an instance of the JspWriter class, and is the content commonly used to output content to the client 1 void Clear () clears the contents of the buffer 2 void Clearbuffer () Clears the current contents of the buffer 3 void flush () empties the stream 4 int getbuffersize () returns the buffer in the size of the number of bytes, if the buffer is not set to the int getremaining () return buffer and how much remaining is available 6 Boolean Isautoflush () returns whether the buffer is full, is automatically emptied or throws an exception 7 void close () closes the output stream Page object is pointing to the current JSP page itself, a bit like the this pointer in the class, It is an instance of the Java.lang.Object class. 1 class GetClass returns this object of 2 int hashcode () returns the hash code of this object 3 Boolean equals (Object obj) Determines whether this object is equal to the specified Object object 4 void Copy (object obj) copies this object to the specified Object object 5 object Clone () clones this object object 6 String toString () Converts this object object to a string Class 7 void Notify () wakes up a waiting thread 8 void Notifyall () wakes up all waiting threads 9 voidWait (int timeout) causes a thread to wait until timeout ends or wakes up with a thread waiting until it wakes up one after the other () void Entermonitor () to object locking Exitmonitor () Application Object Application object to unlock objects to achieve the sharing of data between users, can hold global variables. It starts at the start of the server until the server shuts down, during which time this object will persist, so that the same properties of the object can be manipulated on the user's back-and-forth connection or in a connection between different users, and the operation of this object property anywhere will affect access to it by other users. The startup and shutdown of the server determines the life of the Application object. It is an instance of the ServletContext class. 1 Object getattribute (string name) returns the property value of the given Name 2 enumeration Getattributenames () returns an enumeration of all available property names 3 void SetAttribute (string Name,object obj) Set property value of attribute 4 void RemoveAttribute (string name) Delete one property and its property value 5 String getserverinfo () returns the JSP (SERVLET) engine name and version number 6 String Getrealpath (string path) returns the true path of a virtual path 7 ServletContext getcontext (String uripath) Returns the Application object of the specified WebApplication 8 int getmajorversion () returns the maximum version number of the Servlet API supported by the server 9 int getminorversion () Returns the minimum version number of the Servlet API supported by the server. String GetMimeType (String file) returns the MIME type of the specified file, one URL getresource (string path) returns the specified resource (file and directory) The URL path of InputStream getresourceasstream (string path) returns the input stream of the specified resource RequestDispatcher getrequestdispatcher (string Uripath) Returns the RequestDispatcher object for the specified resource. Servlet getservlet (String name) returns the SERVLET15 enumeration Getservlets () for the specified name Returns an enumeration of all Servlets exception objects exception object is an exception object, which occurs when a page has an exception when it is running. If a JSP page is to be applied to this object, the Iserrorpage must be set to true, otherwise it cannot be compiled. He's actually a Java.lang.Throwable object. 1 string GetMessage () returns a message describing the exception 2 string toString () returns a short description of the exception message 3 void Printstacktrace () Show exception and its stack track 4 Throwable fillinstacktrace () The execution stack trace of the override Exception PageContext object PageContext object provides access to all objects and namespaces within the JSP page. In other words, he can access to the session where this page is located, but also to take the application of a property value, he is equivalent to the page of all the functions of the synthesizer, and its class name is also called PageContext. 1 JspWriter getout () returns the current client response used by the JspWriter stream (out) 2 HttpSession getsession () returns the HttpSession object in the current page (session) 3 object GetPage () Returns the object object of the current page (page) 4 servletrequest getrequest () returns the ServletRequest object of the current page (request) 5 Servletresponse GetResponse () returns the Servletresponse object of the current page (response) 6 Exception getexception () returns the Exception object of the current page (Exception) 7 ServletConfig Getservletconfig () returns the ServletConfig object (config) of the current page 8 ServletContext getservletcontext () Returns the ServletContext object of the current page (application) 9 void SetattributE (String name,object attribute) set properties and property values of ten void SetAttribute (string name,object obj,int scope) Set properties and property values within a specified range public Ob Ject getattribute (string name) takes the value of the property of the object GetAttribute (string name,int scope) to take the value of the property within the specified range. Public Object Findattribu Te (String name) looks for a property, returns the property value, or the Nullconfig object Config object is used by the JSP engine to pass information to it when a servlet is initialized. This information includes parameters to be used when the servlet initializes (through property names and property values) and information about the server (by passing a ServletContext object) Ordinal method description 1 ServletContext getservletcontext () Returns the ServletContext object containing information about the server 2 string getinitparameter (string name) returns the value of the initialization parameter 3 enumeration Getinitparameternames () Returns an enumeration of all parameters required by the servlet initialization

Nine large built-in object!!!

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.