Came across this when I was doing some research on cachespec.xml .
There are two JSP include mechanisms: the @include directive and the jsp:include
action
@include directive :
eg: <%@include file="../../Common/JSTLEnvironmentSetup.jspf" %>
jsp:include
eg: <jsp:include page="../AddressbookSubsection/AccountForm.jsp" flush="true">
<jsp:param name="addressId" value="${final.contactInfoIdentifier.uniqueID}" />
<jsp:param name="firstName" value="${final.contactName.firstName}"/>
<jsp:param name="lastName" value="${final.contactName.lastName}"/>
.
.
....
</jsp:include>
When the WebSphere Application Server dynamic cache caches the output of a JSP,
it also caches the JSP fragments produced by executing its jsp:include actions.
Subsequent requests for the including JSP are served from the cache as long as all its
included fragments can also be served from the cache. If any of its fragments are no
longer in the cache (a "cache miss") the including JSP is re-executed. However, any
fragments still in the cache are included, thus avoiding re-execution of the
jsp:include actions that produced them.
There are two JSP include mechanisms: the @include directive and the jsp:include
action
@include directive :
- static
- it is interpreted at compile time.
- It includes text from the referenced HTML or JSP file before the including JSP is
- compiled.
- Once the including JSP has been compiled, subsequent changes to the
- included file have no effect on the output produced by the including JSP, until it is
- recompiled.
eg: <%@include file="../../Common/JSTLEnvironmentSetup.jspf" %>
jsp:include
- dynamic.
- The referenced JSP is re-executed each time the including JSP is execute.
- The resulting dynamically generated text (referred to as a "JSP fragment") is included in the output of the
- including JSP.
eg: <jsp:include page="../AddressbookSubsection/AccountForm.jsp" flush="true">
<jsp:param name="addressId" value="${final.contactInfoIdentifier.uniqueID}" />
<jsp:param name="firstName" value="${final.contactName.firstName}"/>
<jsp:param name="lastName" value="${final.contactName.lastName}"/>
.
.
....
</jsp:include>
When the WebSphere Application Server dynamic cache caches the output of a JSP,
it also caches the JSP fragments produced by executing its jsp:include actions.
Subsequent requests for the including JSP are served from the cache as long as all its
included fragments can also be served from the cache. If any of its fragments are no
longer in the cache (a "cache miss") the including JSP is re-executed. However, any
fragments still in the cache are included, thus avoiding re-execution of the
jsp:include actions that produced them.