Attributes and functions of the page command

Source: Internet
Author: User

Syntax Rules:

<@ % PAGE attribute1 = "value1" attribute2 = "value2 "............ %>,PageCommand<% @ PageStart%>End.

PageCommonly used instruction table:

 

Attribute

Definition

Language = "scriptlanguage"

Specifies the language used for compiling JSP Container. Currently, only Java is supported. The default value is Java.

Extends = "classname"

Define which servlet is generated on this JSP page

Import = "importlist"

Define the Java APIs used by this JSP page

Session = "true | false"

Determines whether the page uses the session object. The default value is true.

Buffer = "none | size in KB"

Determines whether the output stream is a buffer. The default value is 8 KB.

Autoflush = "true | false"

Determines whether to automatically clear the buffer of the output stream after it is slow. If the buffer is slow, an exception (exception) is generated. The default value is true.

Isthreadsafe = "true | false"

Whether the thread is supported. The default value is true.

Errorpage = "url"

If an exception occurs on this page, the page points to a URL again.

Iserrorpage = "true | false"

Indicates whether this page is an error handling page. The default value is false.

Contenttype = "text/html; charset = gb2312"

Mime Type and JSP encoding method. Examples left

Pageencoding = "ISO-8859-1"

Encoding method. (I have added the encoding used)

Isellgnored = "true | false"

Indicates whether the El expression is in this JSP page. If the value is true, the parameter is ignored. If the value is false, the parameter is supported. The default value is false.

The page command is a command for the current page. There are eight commonly used page commands:

1. <% @ page Language = "Java" %> sets the language used in JSP. Java is used and is currently the only valid setting.

2. <% @ page extends = "mypackage. myclass "%> set the parent class to be inherited by JSP. Generally, you do not need to set it. By default, the default parent class of the JSP page is httpjspbase.

3. <% @ page import = "Java. SQL. *" %> JSP page class

4. <% @ page errorpage = "error. JSP "%> set the page to be transferred when an exception occurs on this JSP page. If not set, the container will use the current page to display the error message.

5. <% @ page iserrorpage = "true" %> sets whether the JSP page is displayed as an error page. The default value is false. If it is set to true, the container will generate an exception object on the current page.

6. <% @ page contenttype = "text/html; charset = gb2312" %> set the page file format and encoding method

7. <% @ page isthreadsafe = "true" %> set whether the container runs the JSP page in multiple threads or in a single thread. The default value is true and the default value is multi-thread. If this parameter is set to false, the JSP page is run in a single thread mode.

8. <% @ page session = "true" %> sets whether the session object can be used for the JSP page (the JSP built-in object is created for the Web Container). The default value is true and the session can be used. if it is set to false, no

Language: defines the script language to be used. Currently, it can only be "Java", that is, language = "Java ".

Import: similar to General Java import, it is used to introduce the class to be used, but separated by commas. By default, no other classes or packages are introduced. For example, import = "Java. Io. *, java. util. hashtable ".

Session: specify whether the page is involved in the HTTP session. The default value is true, and session = "true ".

Buffer: Specifies the buffer mode for the customer output stream. If the value is none, no buffer is provided. If the value is specified, the output is buffered with a buffer not smaller than this value. Used with autoflash. The default value is no less than 8 KB, which can be set based on different servers. For example, buffer = "64kb ".

Autoflash: If the value true indicates that the buffer is full, the client output is refreshed. If the value false indicates that the buffer is full, an exception occurs, indicating that the buffer overflows. The default value is true, for example, autoflash = "true ".

Info: defines a string for JSP page information, which can be obtained using Servlet. getservletinfo. Omitted by default. For example, info = "test page ".

 

Iserrorpage: indicates whether the current page is the errorpage target of another page. If it is set to true, the exception object can be used. On the contrary, if it is set to false, the exception object cannot be used. The default value is false. For example, iserrorpage = "true ".

Errorpage: defines the page called when an exception occurs on this page. Ignored by default, such as errorpage = "error. jsp ".

Isthreadsafe: Used to set whether JSP files can be used in multiple threads. If it is set to true, a JSP can process requests from multiple users at the same time. If it is set to false, a JSP can only process one request at a time. For example, isthreadsafe = "true ".

Contenttype: defines the MIME type of JSP character encoding and page response. Type = MIME type; charset = charset. The default is type = text/html, charset = iso8859-1. For example, contenttype = "text/html; charset = gb2312"

Pageencoding: The character encoding of the JSP page. The default value is pageencoding = "iso-8859-1", such as pageencoding = "gb2312 ".

iselignored: Specifies whether El (Expression Language) is ignored. If it is true, the container ignores the calculation of the "$ {}" expression. The default value is determined by the version of the web. XML description file. Versions earlier than servlet2.3 are ignored. For example, iselignored = "true ".

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.