<jsp:include> and <c:import>

Source: Internet
Author: User

Directive:<%@ include file= ""%>

Function: Reads the contents of the specified page. and combine the content with the original page. (This process is in the translation phase: The JSP is transformed into a servlet stage), the code that was introduced into the file is added to the introduction page to synthesize a file.

action: < Jsp:include page= "Dae. JSP "flush=" true "/>

role: The Include action element is executed during the request processing phase, where the request processing phase is explained. The JSP container is responsible for invoking the JSP page implementation class to process each request and generate an answer, in addition to the above-mentioned conversion of the JSP page into a servlet. This stage is called the request processing phase. The request processing phase executes only the class file.

So when we introduce a page as an include action element, we actually just reference the date. JSP this file is converted and generated after the servlet class file is compiled.

<c:import>

In addition to assigning parameters and managing local file contents, c:import You can also introduce content from external sites. Use c:import The real advantage of is that it can introduce content or Web applications from external Web sites. As you learned jsp:includes earlier, you might have noticed that we use the file property to specify static content for the include. The file property, as its name implies, allows you to introduce the contents of a local file. c:import The corresponding property of is , which is also as its name implies, enables you to introduce any URL. c:import not only can use the contents of a local file to populate your Web pages, but it also allows you to introduce the contents of any URL, so that the content of other sites can be truly flexible to suit the look and feel of your own site.

<jsp:include> and <c:import>

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.