This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Question on including file by directive Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Question on including file by directive" Watch "Question on including file by directive" New topic
Author

Question on including file by directive

Jingh Yi
Ranch Hand

Joined: Mar 23, 2005
Posts: 90
My view.jsp:

<html>
<body>
AAAAAAAAAA
<%@ include file="footer.html" %>
</body>
</html>

Then, I changed content of footer.html, then I access the view.jsp again. How come view.jsp now shows new content of footer.html?

I'm confused. Since I didn't change view.jsp and directive include happens at translation time, the content of view.jsp should not be changed. Right?

Thanks,
Jenny
shiva viswanathan
Ranch Hand

Joined: Aug 12, 2004
Posts: 152
Hi Jenny

My guess is you are using one of the popular web servers like tomcat , weblogic , websphere etc

These are termed as "intelligent servers"(as termed in HFSJ)
which can detect when the file has been changed even when you make use of include directive

Hence for most modern web servers include directive works same as jsp irective even though it is not guaranteed by the spec

Catch You Later
Shiva
Jingh Yi
Ranch Hand

Joined: Mar 23, 2005
Posts: 90
Thanks, Shiva! Tomcat is too smart for me...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Question on including file by directive
 
Similar Threads
HFSJ final mock exam question
Doubt in Final Mock Exam:HFSJ
HFSJ Mock Exam
Question 22 on HFSJ Mock :Confusing Text
Doubt on HFSJ Final Mock Exam #22