Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

when to use jsp:include

 
Ashu Jain
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know that include directive adds content of the file at translation time and jsp: include adds at runtime means when a request is made.

I do not understand when ( scenarios) do we prefer to use jsp:include and when to use include directive.
 
Praveen Kumar
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ashu Jain ,

Use include dir where you are page is updated less.

Use Include action where you have regular updates to the page.

I think HFSJ has some 10 pages regarding this topic. You can go once again.

Prefer include dir at production env.


Praveen
SCJP,SCWCD.
 
Sandeep Bhandari
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just for info,

here is a comparison of jsp:include and c:import

c:import vs jsp:include
 
Ashu Jain
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks .... Really helped
 
Anton Golovin
Ranch Hand
Posts: 527
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Think about it:

1) You use a variable in your included file that you specify in your main file. What is the appropriate scope for that usage not to cause an error?

2) You do not have such code in your included file, and you would like your included file to be evaluated, and the results included, into your main file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic