• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSP and Servlets

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are the difference between JSP and Servlets?
 
Ranch Hand
Posts: 393
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure why this got posted in the 'Distributed Java' forum...

Moving to the JSP forum...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic