I'll give it a shot. based on the above poster's example.
When I go to the directive.jsp page, this is what appears on my browser:
[Time now is Thu Apr 03 19:29:47 EDT 2008]
I then close the browser, and go back to it five minutes later, and it says the SAME thing (Well, according to the poster of the example, it should say the same thing, unless your container checks for timestamps).
[Time now is Thu Apr 03 19:29:47 EDT 2008]. SAME as before
On the other hand, if I did the same thing with the action.jsp, the time would change.
[Time now is Thu Apr 03 19:29:47 EDT 2008] first time
[Time now is Thu Apr 03 19:34:47 EDT 2008] second time, accessed five minutes later
The reasoning for this is how the container handles the directive include(<%@ include...) versus how the container handles the include standard action (<jsp:include...).
It has to do with how the jsp gets turned into a
servlet.
When using the directive, the code from the included jsp page (header.jsp) gets shoved into the directive.jsp, then the container
turns it into a single servlet.
On the other hand, using jsp:include, the code from the included jsp page (header.jsp) isn't shoved into action.jsp. Instead, the container
generates two servlets (one for header.jsp and one for action.jsp). A method is then placed into the servlet created from the action.jsp. This method
tells the container to call the servlet created from the header.jsp. The container then combines both results into one page.