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

difference between Servlets and JSPs  RSS feed

 
sriswati kanth
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what makes the difference between servlet and jsp

[ Edited to use a meaningful title - Paul Sturrock ]
[ October 27, 2008: Message edited by: Paul Sturrock ]
 
Vijitha Kumara
Saloon Keeper
Posts: 3998
42
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP's main concern is to prevent developers coding the HTML code inside java (i.e : within servlet). So it has many features like EL,JSTL,Standard Actions etc... But After all JSP becomes a servlet in the container when serving the client requests. You may go through servlet FAQ and Jsp FAQ here at JavaRanch.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vijitha Kumara:
So it has many features like EL,JSTL,Standard Actions etc...


yes. typically used for presentation .also jsp is a precompiled where servlet(mainly used as a controller) is not
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

also jsp is a precompiled where servlet(mainly used as a controller) is not

Actually, it is the other way round. Servlets are Java classes, so must be compiled. JSPs are written in a tag language that is interprested to product Servlets which are then compiled. It is possible to precompile JSPs, but the normal behaviour is to just let the container create and compile the Servlet on demand.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please see this article for an explanation of what JSP is all about.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!