wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes include action vs. include directive Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "include action vs. include directive" Watch "include action vs. include directive" New topic
Author

include action vs. include directive

Dumitru Husleag
Greenhorn

Joined: Oct 01, 2003
Posts: 22
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.


Dumitru
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
include file is done at translation-time.
include page is done at Request-time.
So, I'd think that include page is more recent.


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Dumitru Husleag
Greenhorn

Joined: Oct 01, 2003
Posts: 22
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: include action vs. include directive
 
Similar Threads
Difference between static and dynamic include
jsp:include
how to include one jsf page in another jsf page ?
how to include one jsf page in another jsf page ?
the answer is not right?