• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp:include and %@ include

 
Mike Broad
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<%@ 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
Posts: 315
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!!
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic