What is the difference between <% pageContext.include("a.jsp"); %> and <jsp:include page = "a.jsp" />
People laugh at me just because i am different and i laugh on them just because they all are same.That's ATTITUDE<br /> <br />IBM DB2 8.1<br />SCJP 1.4<br />SCWCD 1.4<br />Oracle 9i-007<br />IBM XML 142<br />SCJA<br />SCBCD5<br />SCDJWS<br />IBM Websphere MQ 994<br />IBM SOA 664
The first one allows you to specify a variable url in your JSP, whereas last two need a literal (hardcoded) String as the URL.
Another difference is that The last one i.e. include directive lets you include files at the time the JSP page is translated into a servlet. They actually become part of the generated servlet code. Changing the file that is included won't have an effect until the jsp is modified and recompiled. Whereas the first two include the file at execution time so modifications to the included file will be noticed the next time the page is executed.
I would like to second you on that.In jsp:include you can provide variable URI.As far as i know you can provide request time values for dynamic inclusion but you cant do so in case of static inclusion. So i think the point i mentioned is perhaps the only difference between pagecontext.include and jsp:include.But may be i am wrong.