JSP tutorial (2)

zhaozj2021-02-16  54

JSP Directive Mso-Hansi-Font-Family: ""> The overall structure of the servlet class. It often uses the following form: <% @ Directive Attribute = "Value"%> and 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 some things like Import Classes, define superclass, mso-hansi-font-family: "", etc., include files to servlet In the class (when the JSP file is translated into servlet). I. JSP Page Directive Syntax: <% @ Page [Language = "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 "] [iSerrorPage =" true | false "]%> Page Directive MSO-Hansi-font-family:"> Allow you Define some properties of case-sensitive: (1) Import = "package.class" or import = "package.class1, .., package.classn". MSO-Hansi-Font-Family: ""> You can try your IMPORT package. For example: <% @ page import = "java.util. *"%> IMPORT attribute 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".

For example: <% @ page contenttype = "text / place"%> "in Scriptle (" text / plain ");%> (3) iSthreadsafe =" true | false ". If value To "True" indicates that ordinary servlet processing, multiple requests will be parallel to a servlet instance, in which case the programmer is synchronized to access multiple instance variables. The value is "false" : Servlet will implement single-threaded mode, regardless of whether the request is sequential or concurrent, will provide different separation servlet instances. (4) session = "true | false". If the value is "true" (default Represents: Presented Variables Session (inherited httpsession) should be bound to an existing session, otherwise it should be created and will be bind it. The value is "false" indicates: Will not use the session variable, if you try to use, An error will occur when the JSP is converted to servlet. (5) Buffer = "sizekb | none". The size of the buffer is determined for the JSPWriter. The default is determined by the server, but at least 8KB. (6) Autoflush = "True | "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:" ">" When it is said: When it is buffered, it is very useful. This is rarely used. When buffer = "none" is illegible with false mso-hansi-font-family: ""> value. (7) Extends = " Package.class ". This will produce a superclass for servlet. Please use this feature special care, because the server may have defined one. (8) Info =" message ". Define one can be obtained by calling the GetServletInfo method Skewer. (9) ErrorPage = "URL". Specify a JSP MSO-Hansi-Font-Family: "" page to handle any unexpected error that can be thrown but current page. (10) iSerrorpage = " True | false. "Specifies whether the current page can handle errors from another page, default" FAL SE ". (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.

转载请注明原文地址:https://www.9cbs.com/read-20428.html

New Post(0)