Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet vs jsp

 
vara prasad
Ranch Hand
Posts: 47
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can i decide whether projects have to be done on servlets or jsps?
what are the design patterns that is generally follwed while working on servlets?
 
Vishal Pai
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most web applications follow the MVC architechture. In this as a rule generally servlets form a part of the "Model" or "Controller" at times, while JSPs form a part of the "View".

So the project could use both, JSPs are to be used for presentation while servlets to do the server-side processing and handling of client requests.
 
Ajnam Bujanany
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Servlets are used for Controller and JSPs are used for views in MVC model.Ultimately a JSP is also converted into Servlet.Most of the time the servlets are used when you have to write more Java code and less HTML code while JSPs are used when you have to write more HTML and less Java.In a project both JSPs and Servlets can be used.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are very few questions that have been asked more than this one, both here and elsewhere. Type "Servlets vs JSPs" into the search field in either this forum or the Servlets form and you will find plenty of discussions.

Personally, I think the question is flawed. It's like asking about "Knife vs Plate". The two technologies are complimentary, and don't compete with one another.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic