File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes should I use Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "should I use "#include" or "jsp:include"  ?" Watch "should I use "#include" or "jsp:include"  ?" New topic

should I use "#include" or "jsp:include" ?

mike zhang
Ranch Hand

Joined: Feb 26, 2002
Posts: 59
I need to include a header file in my jsp file. I want to make sure that this header file's content can be changed at any time and my jsp page should automatically load the up-to-date version without need to do anything (like restart server, remove .class file, etc). Should <#include file = "">
or <jsp:include page = ""/> suit this purpose ?
I myself assume maybe I should use the <jsp:include /> instead of the other one. Is that true ?
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8927

I think u were talking about <include file=" .." and not <#include ..>
U can <jsp:include for ur case so any changes made to the file is reflected immediately.
[ April 29, 2002: Message edited by: pradeep bhat ][/QB]

Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

The JSP options for include are:

<%@ include page="foo" %>

<jsp:include page="foo" flush="true" />

Check this (very old) link for some more details
I agree. Here's the link:
subject: should I use "#include" or "jsp:include" ?
It's not a secret anymore!