This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Servlets and the fly likes JSP & Servlet Differences Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "JSP & Servlet Differences" Watch "JSP & Servlet Differences" New topic

JSP & Servlet Differences

pulijala hari
Ranch Hand

Joined: May 14, 2005
Posts: 70
Hi all,

I would like to know What can be done with Servlets that can not be done by JSP? and vice versa?

Could you please let me know this as this was asked in an interview for me?

David O'Meara

Joined: Mar 06, 2001
Posts: 13459

This has been discussed recently.
[ October 10, 2005: Message edited by: David O'Meara ]
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Whatever you can do with JSP, Servlet can do that because ultimately JSP is converted into Servlet before execution and after compilation.

I am not sure whether JSP can do all servlet works.
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Not quite, a JSP also has access to things like Tag libraries and JSTL which are not available in Servlets. Some of these features can be accomplished in other ways in Servlets, but not all.
Don't get me started about those stupid light bulbs.
subject: JSP & Servlet Differences