This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes main use of servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "main use of servlet?" Watch "main use of servlet?" New topic
Author

main use of servlet?

Mahesh Pinnamaneni
Ranch Hand

Joined: Jul 02, 2004
Posts: 100
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
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

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.


GenRocket - Experts at Building Test Data
Julian Kennedy
Ranch Hand

Joined: Aug 02, 2004
Posts: 823
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
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: main use of servlet?
 
Similar Threads
Situation like this..
constructors...
Passed 77 tanks to JavaRanch
Can JSP and Servlets do everything doing by EJB
Struts book for a newbie