aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "should I use "#include" or "jsp:include"  ?" Watch "should I use "#include" or "jsp:include"  ?" New topic
Author

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 ?
Thanks,
Mike
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8898

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]


Groovy
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

The JSP options for include are:

directive:
<%@ include page="foo" %>

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

Check this (very old) link for some more details
http://www.coderanch.com/t/351594/Servlets/java/passing-parameters-included-jsp-file
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: should I use "#include" or "jsp:include" ?
 
Similar Threads
include page directives
Difference Between jsp include directive and include action element.
Including a File
HELP! Weird Include problem!
Including files from different directories