This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
You can use JSP with include directive because the content of the included JSP is copied in the calling JSP. For e.g I have a Jsp: a.jsp-> and I include it in b.jsp:
The code of the b_jsp.java will be something like this: out.print("<html> <body>"); out.print("Dear User..."); out.print("<h1> Welcome to my page </h1>"); out.print("</body></html>"); Thus the code from a.jsp is merely copied in the resulting java file of b.jsp. You can also take it as, source of jsp is included in the calling jsp page. I hope it is clear to you now, why jsp being dynamic can be used with include directive and why servlet cannot be used. [ May 07, 2007: Message edited by: Rancy Chadha ]