<% @ Directive Attribute = "Value"%>
Moreover, you can write multiple properties in a statement:
<% @ Directive Attribute1 = "Value1" Attribute2 = "Value2" Attributen = "VALUEN"%>
There are two main Directive:
Page, allowing you to do something similar to Import Classes, define the superclass of the servlet,
MSO-HANSI-FONT-FAMILY: ""> etc;
Include, allow you to insert files into the servlet class (when JSP file is translated into servlet).
First, JSP Page Directive
grammar:
<% @ Page = "java"] [EXTENDS = "package .class"] [import = "{package .class |. *}, ..."] [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 "] [ISERRPAGE =" True | False "]%>
Page Directive MSO-Hansi-font-family: "" Allows you to define some case-sensitive properties:
(1) Import = "package.class" or import = "package.class1, .., package.classn".
MSO-Hansi-Font-Family: "">
You can try your IMPORT package. E.g:
<% @ Page Import = "java.util. *"%>
The IMPORT property is the only one in these properties that can occur multiple times in a JSP.
(2) ContentYpe = "mime = type" or contenttype = "mime-type; charSet = character-set" mso-hansi-font-family: "">>
It specifies the output MIME type. The default is "Text / HTML". E.g:
<% @ Page ContentType = "Text / Plain"%> "in Scriptlet Medium price:
<% Response.setContentType ("text / plain");%>
(3) iSthreadsafe = "true | false". If the value is "true" indicates that ordinary servlet processing, multiple requests will be handled in parallel by a servlet instance, in which case the programmer synchronization Access multiple instance variables. When the value is "false", it means that the servlet will implement single-threaded modhmodel, regardless of whether the request is sequential or concurrent, and will provide different separation servlet instances.
(4) Session = "True | FALSE". If the value is "true" (default) indicates that the predefined variable session should be bound to an existing session, otherwise it should be created and bind it. When the value is "false", it means: If the session variable will not be used, if you try to use, an error will occur when the JSP is converted to servlet.
(5) Buffer = "sizekb | none". Output the size of the buffer to the JSPWriter. The default is determined by the server, but at least 8KB.
(6) Autoflush = "True | FALSE". If the value is "True Mso-Hansi-Font-Family:"> "(default) indicates that it will be automatically emptied when it is buffered, the value is" false mso-hansi-font-family: ">" means: ">" Exercise an exception when it is built, which is rarely used. When buffer = "none" is not legal if you use false mso-hansi-font-family: "">.
(7) Extends = "package.class". This will create a superclass for the servlet. Please use this feature special carefully because the server may have defined one.
(8) Info = "message". Define a string that can be obtained by calling the GetServletInfo method.
(9) ErrorPage = "URL". Specify a JSP MSO-Hansi-Font-Family: "" page to handle any accidental errors that can be thrown but the current page is not processed.
(10) iSerrorPage = "True | FALSE". Specifies whether the current page can handle errors from another page, default is "false".
(11) Language = "Java" MSO-Hansi-font-family: "">. It is pointed out the language below will be used. However, it is not necessary for this property, because "Java Mso-Hansi-Font-Family:"> "is the only legal choice for the default.
Two JSP Include Directive This Directive allows you to include a file when JSP is converted to servlet. grammar:
Let's take an example, and many sites contain a small navigation bar on each page. It usually appears on the top or left and right side of the page and is included in each page. This is very natural with include Directive. If you use the rule of HTML MSO-HANSI-FONT-FAMILY: "", it is undoubtedly a dream. Please see the following code:
Because the file is inserted when the page is converted, so if the navigation strip changes, you need to re-compile all the JSP MSO-Hansi-font-family: ""> pages that point to it. If your navigation bar does not often change this, it is undoubtedly efficient, but if your containment file changes frequently, it is recommended that you use JSP: Include Action to replace it, it is requested at the page. Only the file is included.
<% @ Directive Attribute = "Value"%>
Moreover, you can write multiple properties in a statement:
<% @ Directive Attribute1 = "Value1" Attribute2 = "Value2" Attributen = "VALUEN"%>
There are two main Directive:
Page, allowing you to do something similar to Import Classes, define superclass, mso-hansi-font-family: "", etc .;
Include, allow you to insert files into the servlet class (when JSP file is translated into servlet).
First, JSP Page Directive
grammar:
<% @ Page = "java"] [EXTENDS = "package .class"] [import = "{package .class |. *}, ..."] [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 "] [ISERRPAGE =" True | False "]%>
Page Directive MSO-Hansi-font-family: "" Allows you to define some case-sensitive properties:
(1) Import = "package.class" or import = "package.class1, .., package.classn".
MSO-Hansi-Font-Family: "">
You can try your IMPORT package. E.g:
<% @ Page Import = "java.util. *"%>
The IMPORT property is the only one in these properties that can occur multiple times in a JSP.
(2) ContentYpe = "mime = type" or contenttype = "mime-type; charSet = character-set" mso-hansi-font-family: "">>
It specifies the output MIME type. The default is "Text / HTML". E.g:
<% @ Page ContentType = "Text / Plain"%> "
Medium price in Scriptlet:
<% Response.setContentType ("text / plain");%>
(3) iSthreadsafe = "true | false". If the value is "true" indicates that ordinary servlet processing, multiple requests will be handled in parallel by a servlet instance, in which case the programmer synchronization Access multiple instance variables. When the value is "false", it means that the servlet will implement single-threaded modhmodel, regardless of whether the request is sequential or concurrent, and will provide different separation servlet instances.
(4) Session = "True | FALSE". If the value is "true" (default) indicates that the predefined variable session should be bound to an existing session, otherwise it should be created and bind it. When the value is "false", it means: If the session variable will not be used, if you try to use, an error will occur when the JSP is converted to servlet. (5) Buffer = "sizekb | none". Output the size of the buffer to the JSPWriter. The default is determined by the server, but at least 8KB.
(6) Autoflush = "True | FALSE". If the value is "True Mso-Hansi-Font-Family:"> "(default) indicates that it will be automatically emptied when it is buffered, the value is" false mso-hansi-font-family: ">" means: ">" Exercise an exception when it is built, which is rarely used. When buffer = "none" is not legal if you use false mso-hansi-font-family: "">.
(7) Extends = "package.class". This will create a superclass for the servlet. Please use this feature special carefully because the server may have defined one.
(8) Info = "message". Define a string that can be obtained by calling the GetServletInfo method.
(9) ErrorPage = "URL". Specify a JSP MSO-Hansi-Font-Family: "" page to handle any accidental errors that can be thrown but the current page is not processed.
(10) iSerrorPage = "True | FALSE". Specifies whether the current page can handle errors from another page, default is "false".
(11) Language = "Java" MSO-Hansi-font-family: "">. It is pointed out the language below will be used. However, it is not necessary for this property, because "Java Mso-Hansi-Font-Family:"> "is the only legal choice for the default.
Two JSP Include Directive This Directive allows you to include a file when JSP is converted to servlet. grammar:
URL MSO-HANSI-FONT-FAMILY: ""> It is usually relative to its JSP page, but the relative "URL" is commonly used, you can use a slash "/" as the beginning of the URL URL MSO-Hansi -Font-Family: ""> The main path of the relative Web Server. The file being included will be parsed in a rule of JSP, so you can use static HTML, Scripting Elements, Directives, and Actions. Let's take an example, and many sites contain a small navigation bar on each page. It usually appears on the top or left and right side of the page and is included in each page. This is very natural with include Directive. If you use the rule of HTML MSO-HANSI-FONT-FAMILY: "", it is undoubtedly a dream. Please see the following code:
Because the file is inserted when the page is converted, so if the navigation strip changes, you need to re-compile all the JSP MSO-Hansi-font-family: ""> pages that point to it. If your navigation bar does not often change this, it is undoubtedly efficient, but if your containment file changes frequently, it is recommended that you use JSP: Include Action to replace it, it is requested at the page. Only the file is included.