I've been reading through HFS&J and I came up with a question while I was going through the review regarding the include page directive and the include standard action.
Let's say I use an include directive in my file A.jsp, which includes the file B.jsp. The first time A.jsp is requested, the contents of B.jsp are copied into A.jsp and the resulting file is then translated into a JavaServlet. Obviously, as servlets are only translated once, if I then change B.jsp and request A.jsp, I don't see the new changes because A.jsp has already been translated. (Granted, I believe the text says that some containers can catch that.)
However, with the <jsp:include> standard action, I'm a little confused. Once again, let's say I'm including B.jsp in A.jsp, but this time, I'll use a standard action to perform the inclusion. The first time A.jsp is requested, it is translated into a servlet - that servlet contains a forward to B.jsp. When this servlet's service method is executed, it forwards the request to B.jsp, which also needs to be translated and initialized. When B.jsp has completed its service method, execution returns to A.jsp's service method.
Now, if I change B.jsp at this point, would I see the change? If B.jsp has already been translated into a servlet, would the container automatically re-translate it when B.jsp is included via A.jsp again? I assumed that, once B.jsp has been translated, it would never be translated again (until it was redeployed). However, in the summary, the text states:
The <jsp:include> standard action includes the response of the included page into the original page at runtime. So the include standard action is considered appropriate for including content that may be updated after deployment, while the include directive is not.
That statement leads me to believe that every time B.jsp is included in A.jsp (via standard action, not directive), B.jsp is retranslated and initialized. If that's the case, how big of a performance hit is this on real-world systems?