what is the difference between Servlet and JSP?Advantage of
JSP over Servelt?Any concept present in JSP which we cant
implement in Servlet?

Answers were Sorted based on User's Feedback



what is the difference between Servlet and JSP?Advantage of JSP over Servelt?Any concept present i..

Answer / naina verma

Difference between servlets and JSP:

1. Servlet = HTML in java code.
JSP = java code in HTML.

2. Servlet support all protocols.
JSP only support HTTP protocol.

3. Servlet has more Dynamic content and less Static.
JSP less Dynamic content and more static content.

4. Servlet has business logic.
JSP has presentation and business logic both.

5. In servlet for any modification recompilation is done.
In JSP no recompilation is done for any modification.

6. Servlet is fast.
JSP is Slow.

Is This Answer Correct ?    0 Yes 0 No

what is the difference between Servlet and JSP?Advantage of JSP over Servelt?Any concept present i..

Answer / d.sharath

servlet: its a java class so for every change we have to
compile the code to reflect the change.Mainly using for
writing business logics.


in jsp java code directly embeded into the html code
in jsp contains the ExpressionLanguage if in our
application development use EL to reduce the application
development time

Is This Answer Correct ?    0 Yes 0 No

what is the difference between Servlet and JSP?Advantage of JSP over Servelt?Any concept present i..

Answer / sarfaraz sheikh

difference between Servlet and JSP::

Servlet::

1) It is a controller which is used into appllication to
collect inputs from end user and pass them to service layer.

2) It is service provider between presentation layer and
service layer.

3)It has less execution time as compare to JSP.

4)It is used to desighn static and dynamic pages for GUI.

5) Servlet doesent has implecit objects but there is an
option to make explicit objects.

6) We can be embeded html or plan text with servlet classes.

7)It suport to http and others protocol.

JSP::

1) 1) It is not controller which is used into appllication
only purpose of desighning GUI.

2) It is service provider between presentation layer and
service layer.

3)It has less execution time as compare to JSP.

4)It is used to desighn static and dynamic pages for GUI.

5) Servlet doesent has implecit objects but there is an
option to make explicit objects.

6) We can be embeded html or plan text with servlet classes.


JSP::

1) 1) It is not controller which is used into appllication
only purpose of desighning GUI.



2) It is service provider between presentation layer and
service layer.

3)It has less execution time as compare to JSP.

4)It is used to desighn static and dynamic pages for GUI.

5) Servlet doesent has implecit objects but there is an
option to make explicit objects.

6) We can be embeded html or plan text with servlet classes.


JSP::

1) 1) It is not controller which is used into appllication
only purpose of desighning GUI.

2) It is not service provider between presentation layer and
service layer but it is component of presentation layer.

3)It has more execution time as compare to servlet.

4)It is used to desighn only dynamic pages for GUI.

5) JSP has implecit objects to implements jsp code.

6) JSP allow to embeded java code into predifined jsp tages.

7) JSP only suport to http protocol.

Is This Answer Correct ?    0 Yes 0 No

what is the difference between Servlet and JSP?Advantage of JSP over Servelt?Any concept present i..

Answer / hemant

here is a good reference http://blaze-core.com/difference-between-jsf-servlet-jsp/

Is This Answer Correct ?    0 Yes 0 No

what is the difference between Servlet and JSP?Advantage of JSP over Servelt?Any concept present i..

Answer / sainath

1:)Jsp is used for input page devolopement and response page
developement sake.

But Servlets not for output generation, used only for
requesthandling,receiving request,processing data,and
communicate with db.

2:)Major problem with Servlet is that dynamic content
generationcode and presentationcode is tightly coupled

Incase of Jsp loosecoupling

Is This Answer Correct ?    0 Yes 1 No

what is the difference between Servlet and JSP?Advantage of JSP over Servelt?Any concept present i..

Answer / sonu

servlet is a java class.while jsp is a file.Internally when
we compile servlet will be generated from jsp file.jsp
complier will be the default one with all application
servers.Manually developed servlets perform more faster
than the servlets generated by the jsps.Jsp are used for the
display purpose only.In servlets we include the presentation
and business logic both

Is This Answer Correct ?    4 Yes 6 No

what is the difference between Servlet and JSP?Advantage of JSP over Servelt?Any concept present i..

Answer / pichha

Servlet is Servlet whereas JSP is JSP n also Servlet

Is This Answer Correct ?    5 Yes 7 No

what is the difference between Servlet and JSP?Advantage of JSP over Servelt?Any concept present i..

Answer / rajesh

Actually There is no difference bw Servlet and jsp

Both are aimed to achive the same result but in normall
usuage ,we can select a jsp as a View and serlvlet as a
container Since we need to seperate the Presentation logic
from Controller part as per MVC 2 architecture.

The question it self is not correct because all the Jsp
would end up in a servlet at LAST.

Thanks
Rajesh
Rajeshr1988@gmail.com

Is This Answer Correct ?    4 Yes 6 No

what is the difference between Servlet and JSP?Advantage of JSP over Servelt?Any concept present i..

Answer / sukanta kumar apnigrahi

servlet is a web component run in side server.it is easy to
write a application program ,it is advance version of html
program. we can't write html prog. in a servlet program.
JSP is a Java server page which is used to write a easy
and reliable java program.we can add HTML program in JSP.
It is slower than servlet.

Is This Answer Correct ?    23 Yes 29 No

what is the difference between Servlet and JSP?Advantage of JSP over Servelt?Any concept present i..

Answer / mkj

1 in jsp we can edbed the code in html tag even we can
create on tag. in servlet we must create java files .

2. for jsp there is no deployment mean web.xml is required
but servlet it required.
3 fast development in jsp but in servlet d process is long .
4.there is diffrence in compilation process..

Is This Answer Correct ?    26 Yes 40 No

Post New Answer

More Servlets Interview Questions

What is a servlet context?

0 Answers  


How can we include static files in the jsp page?

0 Answers  


What is HTTP Session ?

6 Answers  


What is a servlet-to-servlet communcation?

0 Answers  


Write a program to show the functionality of servlets.

0 Answers  






What is the use of request dispatcher interface?

0 Answers  


What is the ServletConfig() and what is its use?

4 Answers   Google,


In the servlets, we are having a web page that is invoking servlets ,username and password? which is checks in database? Suppose the second page also if we want to verify

0 Answers  


What is the difference between Server and Container?

0 Answers  


How do you create connections for number of users, if you want to improve performance?

2 Answers  


How to deal with multi-valued parameters in a servlet?

2 Answers  


What is http servlet in java?

0 Answers  


Categories