Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference bet servelet and jsp

 
mandadi vamsikrishna rao
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai, can any one clarify what is the exact difference between servelet and jsp.
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is not much difference between JSPs and Servlets
We use JSPs for the presentation. We can embed HTML and also Javascript in JSP pages. And its quite difficult to present through Servlet. You will have to use a lot of out.print() commands in it.
JSPs ultimately converted into the servlets when we run the application.
Whereas Servlets are mostly used as a controller. (See MVC Pattern) For logic and not for presentation
 
Rajaguru Ramalingam
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The differences are
1) In Jsp, content generation and content presentation are easily separable..so readablity is easy But in Servlet..we need to embed the Html in java code which is difficult to understand.
2) Jsp gives Http protocol specific functionality only.But servlet may provide Protocol independent functionality that is , servlet may be a http servlet or generic servlet
3) Jsp is an extension of servlet.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic