The difference between <c: import url = "child.jsp" / "> and <jsp: include ...>
I know the performance difference between the next two
Include directive (
<%@ include file="test.jsp" %>): This includes the contents of the file during the compilation phase, that is, 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 run-time-ie when the user makes a request for the page.
But what about the JSTL tag <c:import url="child.jsp" /> is this content included during the compilation phase or runtime?
Thanks!
It is included at runtime. And you can specify an absolute URL (you can enable html from third-party sites)
If you are talking about <jsp: include /> This tag includes jsp runtime. That way you can use it recursively.
About c: include ... is a tag, so (I think) this is the execution step ...
By default with import c: import of the imported resource is included in the JSP string at run time. Although you can also access the resource as a String object or a Reader object.
URL can be absolute (any external web application) or relative (contextual)
NTN