JSP 2 types of include tag differences

Source: Internet
Author: User
As we all know, there are 2 kinds of tags in JSP to contain other JSP or file

1. The include directive is actually Java code

<%@ include file= "xxx.jsp"%>

2, JSP action tag, you can also take parameters

<jsp:include page= "xxx.jsp" >    <jsp:param name= "title" value= "V"/></jsp:include>

Now with my understanding of the simple next two kinds of difference:

1, include directive is the JSP in the compilation phase, all the pages in the page with the instructions included in the compilation and synthesis of an HTML page display, the generated class has only one

2, the JSP tag is compiled separately contains all the JSP, the resulting HTML is composited together, the generated class has multiple

It can be concluded that the use of directives contains multiple JSPs, each JSP can not define a variable of the same name, because there will be conflicting names, and the use of tags do not have this problem

JSP 2 types of include tag differences

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.