Related information:
"21-Day Learning Java Web Development"
Summary of results:
1.page Set JSP page Global properties, acting on the entire JSP page, including statically contained files
2.<%@ Page Property 1 = "Property value 1" Property 2 = "Property value 2"%>
the 3.page directive contains 13 attributes as shown in the table:
1>language used to declare the type of script spoken
2>extends is used to specify which parent class the servlet generated by the JSP page inherits from
3>import used to specify the imported Java package
4>session is used to specify whether the session object can be used in this JSP page
5>buffer used to specify whether the output stream has a buffer
6>autoflush used to specify whether the buffer automatically forces output
7>isthreadsafe is used to specify whether the JPS file supports multithreaded use
8>info used to set information about the JPS file
9>errorpage is used to set if the current JPS file has an exception error, the Web page jumps back to the smelly JSP file that can be processed
10>iserrorpage used to specify whether the JPS file is an exception that can be handled by the JSP file
11>contenttype used to specify the MIME format and Web page encoding format of the JSP file
12>pageencoding used to specify the encoding format of a Web page
13>iselignored is used to specify whether the JSP file supports El expressions
"Language" of 1> instances
1.language is currently only available in the Java language. However, it is not possible to use other languages such as C and C + + in the future. The default value of the Language property is java.
2.<%@ page language= "java"%>
3. If you use MyEclipse to write a JSP, the hint cannot be saved, you need to add a line "<%@ page pageencoding=" gb2312 "%>"
1 <%@ page language= "java" pageencoding= "gb2312"%> 2 3 4 <title>testlanguage</title> 5 6 <body> 7 <% 8 out.println ("Test Language"); output Test language! statement 9 %> </body> </ Html>
View Code
"Extends" of 2> instances
1. You must specify the full name of the class when you set it, that is, the package name plus the class name.
2. Generally rarely used, and must be used with caution, or may limit the ability to compile JSP
3.<%@ page extends= "Inherited parent class"%>
"Import" of 3> instances
1. Similar to import statements in the Java Language Foundation.
2. Some packages have been imported at the time of JSP compilation and can no longer be imported.
java.lang.*;
javax.eervlet.*;
javax.servlet.jsp.*;
javax.servlet.http.*;
3.<%@ page import= "Imported package name"%>
1<%@ page language= "java" pageencoding= "gb2312"Import= "Java.util.*"%>234<title>testimport</title>56<body>7<%8Date now =NewDate ();//declares a date instantiation object9Out.println (now);//Output Current TimeTen%> One</body> A
View Code
"Session" of 4> instances
1. "True" indicates that the session object can be used in a JSP page, and "false" means that the session object cannot be used in a JSP page.
The default value for the 2.session property is "true".
3.<%@ page session= "True|false"%>
5> instances of "buffer"
1. "None" indicates that the output stream does not have buffering capability, if set to specific data such as "40KB" indicates that the set buffer size is 40KB.
2. The default value is "8KB".
3.<%@ page buffer= "none|40kb"%>
"AutoFlush" of 6> instances
1. "True" indicates that the buffer is full when the output is still normal, "false" indicates that the buffer is full when the exception occurs.
2. The "Buffer" property is set to "none" and the "AutoFlush" property cannot be set to "false".
3. The default value is "true".
3.<%@ page autoflush= "True|false"%>
"IsThreadSafe" of 7> instances
1. "True" indicates that the JSP file supports multithreading, "false" means that the JSP file does not support multi-threading.
2. The default value is "true".
3.<%@ page info= "True|false" >
8> instance "Info"
1. Can be any string of information. The Servlet.getservlerinfo method is used to obtain this information.
2.<%@ page info= "JSP file related information"%>
1 <%@ Page language= "java" pageencoding= "gb2312" info= "This is JSP"%> 4 <title> Testinfo</title> 6 <body> 7 <% 8 String str = Getservletinfo (); // declaration string str out.println (str); // output str value 10 %>12
View Code
"ErrorPage" of 9> instances
1.<%@ page errorpage= "error handling pages"%>
"Iserrorpage" of 10> instances
1. The default value is "false".
2.<%@ page iserrorpage= "True|false" >
"Contertype" of 11> instances
1. Specify the MIME format of the JSP file and the page encoding format.
2.<%@ page conterttype= "Teat/html;charset=iso-8859-1"%>
3. "Charset=iso-8859-1" will be garbled, the file can be used "charset=gb2312"
1 <%@ Page language= "java" contenttype= "text/html;charset=gb2312"%> 2 4 <title> Testcontenttype</title> 6 <body> 7 <% 8 String str = "Hello!" JSP "; // declaration string str out.println (str); // output string str value 10 %>12
View Code
"Pageencoding" of 12> instances
1.<%@ page pageencoding= "Iso-8859-1" >
1 <%@ Page pageencoding= "gb2312"%> 3 4 <title>testpageencoding</title> 5 6 <body> 7 <% String str=" Welcome to the JSP Kingdom! "; // declaration string str out.println (str); // output string str value 10 %>12
View Code
"Iselignored" of 13> instances
1. "True" means that the JSP file ignores the El expression and "false" indicates that the EL expression is not ignored.
2.<%@ page iselignored= "True|false" >
Page directive for the java-jsp instruction element