Win a copy of Practical SVG this week in the HTML/CSS/JavaScript 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.
 
when your children are suffering from your punishment, tell your them it will help them write good poetry when they are older. Like this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!