JSP built-in object set

Source: Internet
Author: User

Overview of JSP built-in objects

(1) Request object of the httpservletrequest class
Role: indicates the request object. It is mainly used to receive data transmitted from the client to the server over HTTP.
(2) respone object of the httpservletresponse class
Role: indicates the response object, which is mainly used to send data to the client.
(3) Out object of the jspwriter class
Role: Mainly used to output data to the client;
The base class of out is jspwriter.
(4) Session Object of the httpsession class
Purpose: stores the information of each user separately and the session associated with the request;
Session status maintenance is a must for Web application developers.
(5) Application Object of the servletcontex class
Role: it is mainly used to save user information and the runtime environment of code snippets;
It is a shared built-in object, that is, multiple users in a container share an application object, so the stored information is shared by all users.
(6) pagecontext object of the pagecontext class
Purpose: Manage webpage attributes, wrap the context of the JSP page, and manage access to named objects in special visible parts of JSP, it is created and initialized by the container.
(7) config object of the servletconfig class
Purpose: The code snippet configuration object, indicating the servlet configuration.
(8) object-class page (equivalent to this) object
Purpose: Process JSP web pages. It is an instance of the object class and refers to an instance of the JSP implementation class. That is, it is also the JSP itself and is valid only within the JSP page range.
(9) exception
Purpose: handle errors and exceptions when executing JSP files
It can only be used on the error page, provided that the iserrorpage = true page must be included in the page command;
For example, A. jsp: <% @ page contenttype = "text/html; charset = gb2312" errorpage = "error. jsp" %>
Error. jsp: <% @ page contenttype = "text/html; charset = gb2312" iserrorpage = "true" %>
Then, you can use the exception built-in object on the error. jsp page. The usage is as follows:
<% = Exception. getmessage () %>

Note: attributes in pagecontext are shared on the current page by default;
The attributes in the session are shared in the current session;
The owner of the servletcontext object is shared to all pages;

Mail to sort Ky: huiting820225@sina.com

Trackback: http://tb.blog.csdn.net/TrackBack.aspx? Postid = 201951

 

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.