What is the difference between JSP and SERVLETS

Showing Answers 1 - 17 of 17 Answers

jagdish kaveti

  • Jul 10th, 2005
 

servlet : it is a webcomponet which will handle the request as well as it will give the response in particular display format.i.e it will perform developers tasks and designer's tasks. 
JSP: : it is purely for display purpose.it wil internally create a sevlet for perfoming developers activities. 
NOTE: there is no need of compiling a servlet

  Was this answer useful?  Yes

santosh

  • Jul 27th, 2005
 

Jsp and Servlets are both same when we consider functionality but actually jsp pages are easy to write and basically used for View part of the patterns.

  Was this answer useful?  Yes

b shaik mohamed

  • Aug 3rd, 2005
 

In Jsp we can embeded the compnent such as the java beans  
where as in the servlet we can't embed the compnent like the java beans 
ex.  

  Was this answer useful?  Yes

rajesh karavadi

  • Aug 19th, 2005
 

 
SERVLETS:servlets concentrates on application logic.By using servlet we can do application logic well. 
 
JSP's:jsp will concentrates on presentation view. 
 
Servlets puts HTML code in java code. where as in JSP java code put in a HTML code

  Was this answer useful?  Yes

shyamalatha

  • Sep 21st, 2005
 

servlets provides a way to generate dynamic content and jsp provides a way to create dynamic pages.

  Was this answer useful?  Yes

Chidambara Gupta. Cheedella

  • Sep 21st, 2005
 

Servlets and Java Server Pages are complementary APIs, both providing a means for generating dynamic Web content. Infact JSP's are extensions to servlets which are mainly intended for presentation and to separate presentation from business logic. Functionality wise both are equally good and same.

In Servlets the dynamic content is generated by writing the HTML code embedded in Java code where as in JSP the dynamic content is generated by writing the Java code embedded in HTML code and JSP scriptlets. Finally JSPs are best suit for presentation and servlets are best suit for Controlling purpose.

  Was this answer useful?  Yes

Suman Kumar Gattu

  • Sep 27th, 2005
 

The Difference between JSP and Servlets is JSP separates the Business logic from presentation logic.

  Was this answer useful?  Yes

Amit Saini

  • Dec 15th, 2006
 

Both r same, because jsp is convert into servlet after getting first request,only one difference is that servlet can implements interface but jsp not?Right..?Amit Saini

  Was this answer useful?  Yes

NarendrababuThumati

  • Jul 11th, 2007
 

In servlets there is no in built suppport but in JSP there is in built support. Internally JSP page compiled  into servlet the builder gernarates code not much effcient than manually devloped code.

In JSP separation of business logic from presentation logic.

  Was this answer useful?  Yes

indojapan

  • Mar 2nd, 2009
 

Both JSP and Servlets provide dynamic content features. Its difficult to point out the difference as a JSP is ultimately converted into a Servlet and run on Server. Basically, its the separation of roles played by JSP and Servlet which is important. In an MVC architecture, JSP provide the View or Presentation Logic whereas Servlet provide the Controller logic generally. Other minor differences are - JSP has implicit objects, directives etc.... but ulitimately a JSP is converted to a Servlet.

  Was this answer useful?  Yes

Both are used to develop server side web applications.but mainly the jsp is used to develop presentation logic..jsp uses tags to develop web pages and it embeds java code,html,template text.in this we can also create our own tags..but servlet uses only java code and mainly used to develop business logic..compare to jsp it is quite complex process to execute when changes have been made to application..

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions