• 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

main use of servlet?

 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hai buddies,
can u plz respond to this Q.
*what is the actual use of servlets where all the functionality which is done in servlets can be done by JSP
thanks,
Mahesh
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Servlets are meant to be the Controller in the MVC design pattern and JSPs are meant to be the view.

The main purpose in using Servlets as the controller is to seperate the view from the logic. It makes code a lot cleaner and easier to maintain.
 
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So, in an ideal world, page designers (with no programming skills) can just write JSPs containing no code, just tags that they and their GUI-based design tools understand.

That leaves us server-side programmers (who may have no talent for, or interest in, page design, i.e. me!) to write the code for servlets and beans and leave the arty-farty, pretty stuff to those who care.

Jules
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

where all the functionality which is done in servlets can be done by JSP


Where did that turkey come from?
JSP are a way to make servlets that is optimized for writing HTML pages. In case you have not noticed, there is a lot more to the Internet than HTML pages.
If you want to serve binary data - images, sound, zip files, etc. servlets are the method of choice. Not to mention all the services such as SOAP that can be built on a servlet base.
Bill
 
You ought to ventilate your mind and let the cobwebs out of it. Use this cup to catch the tiny ads:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic