The page command is usually at the top of the jsp page. Multiple page commands can be used on a jsp page. The syntax format of the page command is as follows:
<% @ Page
[Language = "java"]
[Extends = "package. class"]
[Import = "package. class | package. *,..."]
[Session = "true | false"] (sets whether HTTP Session is required for this page)
[Buffer = "none | 8kb | size kb"] (specify the size of the output buffer, in kb)
[AutoFulsh = "true | false"] (whether to force the output buffer content when the output buffer is about to overflow. True --- normal output)
[IsThreadSafe = "true | false"]
[Info = "text"] (set the information of the JSP program, which can also be seen as its description. You can use Servlet. GetServlet () method to obtain this value. If you are on the JSP page, you can directly call getServlet (0 method to obtain this value. Because the JSP page is essentially a Servlet)
[ErrorPage = "relativeURL"]
[ContentType = "mimeType [; charset = characterSet]" | "text/html; charSet =" ISO8859-1 "]
[IsErrorPage = "true | false"]
%>
<! -- Specify info -->
<% @ Page info = "this is a jsp" %>
<HTML>
<HEAD>
<TITLE> test the info attribute of the page command </TITLE>
</HEAD>
<BODY>
<! -- Output info -->
<% = GetServletInfo () %>
</BODY>
</HTML>
After execution, the page travel information is "this is a jsp" (the same as <% @ page info = "this is a jsp" %>)
(INCLUDE command)
The include command can be used to embed an external file into the current JSP file, and parse the JSP statement on this page (if any ),
This is a static include statement that includes other compilation commands on the target page. But dynamic include does not.
<% @ Include file = "relativeURLSpec" %> (relative address), as shown in <% @ include file = "hehe. jsp" %>
If the embedded file needs to change frequently, we recommend that you use the <jsp: include> Operation Command.