Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

JSP and Servlets

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are the difference between JSP and Servlets?
 
Ranch Hand
Posts: 393
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's like almost everything which you can do in servlet ,you can do in JSP too.But one difference i know between JSP and Servlet is :-

Servlet can be written for HTTP(HTTPSERVLET) and other protocols(GENERIC SERVLET) where as we can write JSP only for HTTP protocol.

If anyone else can add any point in this !!!

Regards,

James
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Servlets are used to develop dynamic webcontent ie WebApplications

Servlets are normal java classes Who generally have to extend
javax.servlet.http.HttpServlet class.

These are precompiled classes. (This is nothing but a Servlet Template)
Instead in a JSP java code is embedded in HTML for easier Page generation
as HTML code generation in Servlets could be very tedious if the HTML
data is large.
At Runtime the JSP/Servlet container converts the JSP into a Servlet and
executes it.


Regards
Satish
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure why this got posted in the 'Distributed Java' forum...

Moving to the JSP forum...
 
My cellmate was this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic