JSP Syntax (6)--page instruction

Source: Internet
Author: User
Tags include
js| Syntax Page instruction

Defines global properties in a JSP file.


JSP syntax
<%@ page
[language= "Java"]
[extends= "Package.class"]
[import= "{package.class | package.*}, ..."]
[Session= ' true | false ']
[buffer= "none | 8kb | sizekb"]
[Autoflush= ' true | false ']
[Isthreadsafe= ' true | false ']
[info= "Text"]
[errorpage= "Relativeurl"]
[contenttype= "MimeType] [; Charset=characterset] "| "Text/html; Charset=iso-8859-1 "]
[Iserrorpage= ' true | false ']
%>
Example
<%@ page import= "java.util.*, java.lang.*"%>
<%@ page buffer= "5kb" autoflush= "false"%>
<%@ page errorpage= "error.jsp"%>
Describe
The <%@ page%> instruction acts on the entire JSP page, including the static include file. However, the <% @ Page%> directive does not work on dynamic include files, such as <jsp:include>

You can use multiple <% @ Page%> instructions on one page, but the attributes can only be used once, but there is one exception, which is the import attribute. Because the Import property is similar to the import statement in Java (referencing the Java Language), you can use this attribute more than once.

Regardless of where you put the <% @ Page%> instruction in the JSP file, it is scoped to the entire JSP page. However, for the readability of JSP programs, as well as good programming habits, it is best to put it in the top of the JSP file.


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.