Hi all, What is the main diffrenece between JSP and Servlet......which is faster (Servlet or JSP and why???).When to use servlet and when to use JSP...Please Expalin.
posted 12 years ago
jsp's are nothing, but servlets in the background. A JSP page is compiled into servlet with the first request. jsp's advantage is that with the use of JSP it's easy to seperate presentation with business layer. Designer can maintain the JSP pages, the logic for extracting data for presentation and display can be written in Beans/taglibs. Servlets on the other hand tend to mix presentation with business.so at presentation layer (where a lot of html/wml is involved), you would like to use JSP and if you want to use it as controller(or for anything that involves little or no HTML), you would use servlets. hth