This article mainly introduces JSP compile instruction page, include, need friend can refer to the
1. JSP instruction Category: 1). Page 2. Include 3). Taglib Syntax: <%@ directive name Attribute 1 = value 1 .....%> &n Bsp 2. Page compilation instruction: function: Use page compilation instruction to set the JSP pages properties. Usually at the top of a JSP page, you can have multiple page directives for the same page. page Instruction Syntax format: code as follows: <% @page [language= "Java] //Declaration JSP page Use language type [extends=" pack Age.class "] //jsp the Java class that is generated when the program is compiled, the parent class that needs to be inherited, or the fully qualified class name of the interface that needs to be implemented [import= package.class | package.*},... ] //is used to import packages. Default automatically imported packages: java.lang.*; javax.servlet.*; javax.servlet.jsp.*; javax.servlet.http.* [session= "true | false"] [buffer= none | 8kb | size KB] [autoflush= "true | fals E "] [isthreadsafe=" true | false "] [info=" text "] [errorpage=" Relativeurl "] Specify the error-handling page [contenttype=] mimetype [; Charset=characterset] "| "Text/html;charset=iso8859-1"] [iserrorpage= "true | false"] //Setting this JSP page is the error handler % > 3. Include compilation directives &nbsP • Function: Notifies the container that the current JSP page will contain a static file in the interpreted process, and that the contents of the file contained within the JSP can be parsed by the process that occurs during compilation. In a JSP page, the include directive is not limited in number and can be nested. In theory, nesting is unrestricted, but all pages must use the same scripting language as the Include page. INCLUDE syntax format: <%@ include file= "Relativeurl"%> the benefits of using include compilation directives: You can split a complex JSP page into several simple, The part that is handled separately. This approach greatly enhances the management and flexibility and extensibility of JSP pages. When you want to modify a page, you can modify only the included file that you want to modify. Note: 1) <%@ include file= "test2.jsp"%> error occurred in test1.jsp. Error: Multiple annotations found at:-Duplicate local variable path-duplicate local variable solutions : I: Change path and BasePath in test2.jsp to other names II: Remove path and basepath from test2.jsp