What are JSP and Servlets, and how do they interact?
Joined: Jun 23, 2000
I still did not "touch" to these topics, but I am curious to learn a bit more about those: what they are and how they interact (if there is such interaction). So, please excuse my question if it sounds too simple! In addition to this, what are the best books available? Is there "free" stuff on the web to learn those?
[This message has been edited by Serge Plourde (edited April 24, 2001).]
Thanks, all of you. Those are all great suggestions and links!
Joined: Apr 02, 2001
Hi, JSP is designed to make the life of the programmer easier.Using servlets you can do lots and lots of complicated stuff, but you never tend to use all of them.If that is the case, JSP is the place where you should start from. By design JSP sits on the top of the servlets.What this means is when you write a JSP code and execute it the JSP Engine complies the JSP page as a servlet, and then makes the class file for it.After that the normal life cycle of the servlet, viz. init(), service() and destroy() follows. One more advantage of using JSP rather than Servlets, is that,it seperates static content from dynamic content.This means the HTML code can be designed in parallel with the dynamic code that is generated by the JSP tags.This allows Web developers to work in co-ordination with the Java Developers. Java Developer could make JavaBeans to be used by the Web Developers, who simply use it to generate the dynamic content.The inherent advantage you have with a JSP design is you seperate the business logic from the presentation logic making your page causing lesser maintenance problems. Hope this helps. Regards,