A brief overview of JSP built-in objects

Source: Internet
Author: User
Tags client
js| Objects | Built-in objects

(1) HttpServletRequest class's Request object
Function: Represents the requesting object, which is primarily used to accept data that the client transmits to the server side through the HTTP protocol connection.
(2) The Respone object for the HttpServletResponse class
Action: Represents a response object that is used primarily to send data to the client
(3) The Out object
of the JspWriter class function: Primarily for outputting data to the client; The
        out base class is the session object for the JspWriter
(4) HttpSession class
Role: Mainly used to save each user information separately, the session associated with the request;
         Session state Maintenance is a problem that Web application developers must face.
(5) Servletcontex class Application Object
Role: Mainly used to save user information, code snippets of the operating environment;
        It is a shared built-in object in which multiple users in a container share a Application object, so that the information it holds is shared by all users. The
(6) PageContext class PageContext objects
Function: Manage Web page properties, wrap the context of a page for JSP pages, manage access to named objects that belong to a particular visible part of the JSP, and its creation and initialization are done by the container.
(7) The Config object for the ServletConfig class
function: A code fragment configuration object that represents the configuration of the servlet.
(8) the page (equivalent to this) object of the object
function: Processing JSP Web pages, is an instance of the object class, refers to the JSP implementation class instance, that is, it is also JSP itself, only within the scope of the JSP page is legitimate.
(9) Exception
Action: Errors and exceptions that occur when processing JSP file Execution
        can only be used in the error page. The premise is: in the page instruction to have iserrorpage=true page;
        such as:a.jsp:     <%@ page contenttype= "text/html;charset=gb2312" Errorpage= "error.jsp"%>
             error.jsp:<%@ page contenttype= "text/html;charset=gb2312" iserrorpage= "true"%>
            : You can use the exception built-in object in the Error.jsp page, using the following:
                  <%=exception.getmessage ()%>

Note: The properties in PageContext are shared by default on the current page;
The attributes in the session are shared in the current session;
The genus in the ServletContext object is shared for all pages;







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.