Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

include action vs. include directive

 
Dumitru Husleag
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody,
I had a question in a Brainbench JSP1.2 test like this:
<%@ include file="page2.jsp"%>
<jsp:include page="page2.jsp">
Q: which will include the most recent version of page2.jsp ?
According to JSP.2.10.4 section (Including data in JSP pages - JSP1.2 spec) nothing about it is specified. Even more, in 2.10.3 they say:
"A JSP container can include a mechanism for being notified if an included file changes, so the container can recompile the JSP page. However, the JSP 1.2 specification does not have a way of directing the JSP container that included files have changed."
That means we cannot know.
Anyway if somebody can make these things more clear please do it.
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
include file is done at translation-time.
include page is done at Request-time.
So, I'd think that include page is more recent.
 
Dumitru Husleag
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Roger for pointing the translantion vs. request-time matter.
I've read more on the subject and I think you are right. Even if it isn't clearly marked in the spec.
I guess I could compare with C language like this
- include file is like "#include <file.h>" and
- include page is like linking to a dll and calling a function.
I would consider the subject closed.
Originally posted by Roger Chung-Wee:
include file is done at translation-time.
include page is done at Request-time.
So, I'd think that include page is more recent.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic