Defines the global attributes in the JSP file.
Attributes include:
The JSP syntax is as follows:
<% @ 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" %>
Description
<% @ Page %> the command acts on the entire JSP page, and also includes static inclusion files. However, the <% @ Page %> command cannot act on dynamic include files, such as <JSP: Include>
You can use multiple <% @ Page %> commands on a page, but the attributes can only be used once. However, there is an exception, that is, the import attribute. Because the import attribute is similar to the Import Statement in Java (refer to Java language), you can use this attribute several times.
No matter where you place the <% @ Page %> command in the JSP file, it applies to the entire JSP page. However, for the sake of readability and good programming habits of the JSP program, it is best to put it on the top of the JSP file.