<% @include and Jsp:include

Source: Internet
Author: User

Recently engaged in the page. Refers to the pagination of nested pages, all kinds of mistakes, have done similar before, it is easy to forget, so in this record, I hope the development of you, but also helpful.

Simply say the difference between them:

<jsp:include page= "" > Parent page and the included page are compiled separately, translated into Servlets, and then spelled as an HTML page in the foreground. <% @include file= ""%> the parent page and the included page, after the code is merged, it is translated into a servlet and fed back to the foreground to form an HTML page.


<jsp:include/> Dynamic inclusion, which is not integrated with the current page, is equivalent to invoking a method that contains the interface and the included interface to generate two different class

<% @page include= ""%> static inclusions, incorporating the included pages and the current page into a servlet


Attention:

Do not let the include in the El tag, or although in the code can be linked to nested pages, but in the browser, is not displayed, there is no error message.

Some netizens also said that using

<jsp:include page= "/jsp15/back_manage/pageman.jsp" flush= "true"/ > To add flush= "true"

The book says:
Flush=true, the content of the current page output buffer is refreshed before the target resource is included;
Flush=false, the output buffer of the current page is not refreshed until the file is included.

After I verify, do not need to add is also the line!


You can also refer to this:

http://bbs.csdn.net/topics/330071695

http://bbs.csdn.net/topics/360228154

<% @include and Jsp:include

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.