JSP compile instruction page, include detailed

Source: Internet
Author: User

  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
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.