Where to use <%@include> and <jsp:include> ?

You can use <%@include> where you know that there should not be change in the included file further. When you change the content in your included file you have to redploy your application in order to change effect because the previoue included file is there in the translated servlet.
But in case of <jsp:include> if you change your included file no need to redeploy because the included file is added at run time.
NOTE: In tomcat5 if you change the included file content in case of <%@include> then the change will be reflected without redeploying. But it is not same for all the containers.

No comments:

Post a Comment