This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JSP and the fly likes Difference between Servlet and JSP Interview question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Difference between Servlet and JSP Interview question" Watch "Difference between Servlet and JSP Interview question" New topic
Author

Difference between Servlet and JSP Interview question

Sandeep Awasthi
Ranch Hand

Joined: Oct 23, 2003
Posts: 597
What is difference between Servlet and JSP, can I use JSP where ever Servlet Can be used? Why struts uses ActionServlet why not ActionJSP?


Sandeep
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61092
    
  66

This question gets asked a lot. Please look through previous posts for the answers.

Short version: JSPs are most suitable for renderrng HTML views. They are not well-suited to performing processing. Best practices dictate that the combination of servlets (to do the processing) and JSPs to render the HTML is the best pattern to follow.
[ September 29, 2006: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Difference between Servlet and JSP Interview question