File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "JSP & Servlet Differences" Watch "JSP & Servlet Differences" New topic
Author

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?

regards,
hari
David O'Meara
Rancher

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
Rancher

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JSP & Servlet Differences
 
Similar Threads
Renaming build.xml
Struts error, focus the error field
Can JSP and Servlets do everything doing by EJB
JSp ( a good tricky one)
Building a site