File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Diff Between Servlet and JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Diff Between Servlet and JSP" Watch "Diff Between Servlet and JSP" New topic

Diff Between Servlet and JSP

Mathews P Srampikal
Ranch Hand

Joined: Nov 26, 2002
Posts: 211
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

Joined: Oct 26, 2002
Posts: 76
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 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.
I agree. Here's the link:
subject: Diff Between Servlet and JSP
It's not a secret anymore!