Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

performance difference between <c:import url="child.jsp" /> and <jsp:include ...>

Tags:

java

jsp

jstl

I know the performance difference between the following two

  1. Include directive (<%@ include file="test.jsp" %>): This includes the contents of the file during the compilation phase—i.e., when the page is converted to a servlet.

  2. Include action (<jsp:include page="test.jsp" flush="true" />): This includes the contents of the file in the run-time—i.e., when a request is made for the page by the user.

But what about JSTL tag <c:import url="child.jsp" /> is the content included during the compilation phase or run-time?

Thanks!

like image 739
Koolala Avatar asked Jun 30 '11 14:06

Koolala


People also ask

What is the difference between import and include in JSP?

2. The key difference between include action and JSTL import tag is that the former can only include local resources but later can also include the output of remote resources, JSP pages, or HTML pages outside the web container. include action uses page attribute while import tag uses URL attribute.

What does <% include do in JSP?

The include directive is used to include a file during the translation phase. This directive tells the container to merge the content of other external files with the current JSP during the translation phase.

What is the difference between JSP and tag file?

A tag file is a source file that contains a fragment of JSP code that is reusable as a custom tag. Tag files allow you to create custom tags using JSP syntax. Just as a JSP page gets translated into a servlet class and then compiled, a tag file gets translated into a tag handler and then compiled.


1 Answers

It is included at runtime. And you can put an absolute URL there (you can include html from 3rd party sites)

like image 103
Bozho Avatar answered Oct 21 '22 09:10

Bozho