views:

139

answers:

2

We have been debating between using servlets or JSP pages and we want to know what the common uses of one versus the other. If you read any online guide that you can point us out, will be very grateful.

+1  A: 

Already asked. Check:

Macarse
As noted there, this is a false dichotomy. JSP is just syntactic sugar that is compiled into a servlet.
Matthew Flaschen
A: 

Doing views through servlets are cumbersome and hard to maintain, especially when you want to send a long HTML page. ( imagine writing out.println(...)). Also every single change will require recompilation of servlet. Both JSP's and Servlets are complimentary technologies. JSP is commonly used as the presentation layer combining HTML and Java code. With Servlets, you must embed HTML code with escape characters with out.println("<html>....</html>") which would get very cumbersome and hard to maintain. The JSP technology solves this by providing a level of abstraction so that a developer can use custom tags and action elements, speeding up web development and maintain easier.

Regarding online guides: I would start with JSP Intro Java EE 5 tutorial from Sun.

Chapter 6 is also a good start. (Chapter 6 JSP Java EE 5 tutorial)

zkarthik