This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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: 8904

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" ?
Similar Threads
include page directives
Including files from different directories
Including a File
HELP! Weird Include problem!
Difference Between jsp include directive and include action element.