I know the performance difference between the following two
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.
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!
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.
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.
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.
It is included at runtime. And you can put an absolute URL there (you can include html from 3rd party sites)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With