The include directive inserts the SOURCE of JSP or HTML files at [b]translation time[/b].
But the <jsp:include/> standard action inserts the RESPONSE of the JSP or HTML files [b]at runtime[/b].
There is an exra perfermance hit with every <jsp:include>. With directive, on the other hand, the hit happens only once --- when the including page is translated.
So if you're pretty sure that once you go to production the including file won't change, the directive might be the way to go. Of course there's still tradeoff that the generated servlet class is a little larger when you use the directive.
Tip:如果including page是经常改动的,则应该使用 <jsp:include/>
But the <jsp:include/> standard action inserts the RESPONSE of the JSP or HTML files [b]at runtime[/b].
There is an exra perfermance hit with every <jsp:include>. With directive, on the other hand, the hit happens only once --- when the including page is translated.
So if you're pretty sure that once you go to production the including file won't change, the directive might be the way to go. Of course there's still tradeoff that the generated servlet class is a little larger when you use the directive.
Tip:如果including page是经常改动的,则应该使用 <jsp:include/>