• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Diff Between Servlet and JSP

 
Mathews P Srampikal
Ranch Hand
Posts: 211
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
bharat nagpal
Ranch Hand
Posts: 76
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic