aspose file tools*
The moose likes Servlets and the fly likes  jsp:include and %@ include Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark " jsp:include and %@ include" Watch " jsp:include and %@ include" New topic
Author

jsp:include and %@ include

Mike Broad
Greenhorn

Joined: Mar 29, 2007
Posts: 13
Hi,all
<%@ include > inserts the file at the time the jsp page is transalted into a servlet.<jsp:incldue> inserts the file
at the time the page is requested. can we replace <%@ include>
with <jsp:include>?? Does anyone tell me how the jsp files are
executed in the web server with servlet engine in more detail?
many thanks

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
<%@ include and <jsp:include are different in two (important) aspects:
1. "<%@ include" can use(include) jsp files directly, "<jsp:include" cannot.
2. With "<%@ include", if you modify the included files then you have to recompile the original jsp file. With "<jsp:include", you don't have to.
Jackie Wang
Ranch Hand

Joined: Apr 18, 2002
Posts: 315
Originally posted by the sheik:
<%@ include and <jsp:include are different in two (important) aspects:
1. "<%@ include" can use(include) jsp files directly, "<jsp:include" cannot.
2. With "<%@ include", if you modify the included files then you have to recompile the original jsp file. With "<jsp:include", you don't have to.

what's the meaning of:
"<%@ include" can use(include) jsp files directly, "<jsp:include" cannot.
Still don't get it. Thanks!
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
the sheik and mike
Welcome to the Java Ranch, we hope you�ll enjoy visiting as a regular however,
your name is not in keeping with our naming policy here at the ranch. Please change your display name to an appropriate name as shown in the policy.
Thanks again and we hope to see you around the ranch!!


Dave
Jessica Sant
Sheriff

Joined: Oct 17, 2001
Posts: 4313

hee hee -- nice try Dave -- but "The Sheik" and "Mike" posted that 2 years ago -- don't think they'll be comin back to change their display names...
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

And besides that, they've got it completely backwards.

Since we're talking about old threads, here's one in which I set out the differences:
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: jsp:include and %@ include
 
Similar Threads
Static and Dynamic including of JSP
Difference between %include file=""% and jsp:include file=""
JSP include action
Can JSP's include servlets?
include differences