What is the difference between jsp and servlet?

Answers were Sorted based on User's Feedback



What is the difference between jsp and servlet?..

Answer / sivasubramanian.k

JSP are java server pages which constitute of html pages
embedded in it ie it is useful for both presentation and
application/business logic..It is compiled only once and
each time it is not executed by server..While servlet are
server side programs which are compiled and is executed
each time..

Is This Answer Correct ?    13 Yes 4 No

What is the difference between jsp and servlet?..

Answer / namita

Jsp is defined as Java server pages.
Jsp and servlet both are server side programming language.
the diffence in b/w these two is Jsp is used for
presentation part and servlet is use to give the business
logic.
Servlet act as redirector also. it redirect your page as
per the business logic.

anyhow Jsp are compiled to servlet but Jsp comes in to
picture to separate out the presentation logic from the
servlet to make it loosely coupled.

Is This Answer Correct ?    10 Yes 1 No

What is the difference between jsp and servlet?..

Answer / madhu sudana rao.yadavalli

jsp means java server page ,jsp is laso a servelt .In the
servlet code is written by manually but in jsp code is
generated by the jsp container.
jsp is used where the presentation layer is more, and this
is uesd in medium and larger projects
servlet is used in small projects

adv:
1. jsp can be devolp easly.
2. jsp will take less time.
disadv:
1. it can accupi the more memory(why because it fallow
structural procedure menas by genearting the servlet code
included unnecessry content also)

Is This Answer Correct ?    8 Yes 3 No

What is the difference between jsp and servlet?..

Answer / gabriela

Servlets and Java Server Pages are complementary APIs, both
providing a means for generating dynamic Web content. A
servlet is a Java class implementing the
javax.servlet.Servlet interface that runs within a Web or
application server's servlet engine, servicing client
requests forwarded to it through the server. A Java Server
Page is a slightly more complicated beast. JSP pages contain
a mixture of HTML, Java scripts (not to be confused with
JavaScript), JSP elements, and JSP directives. The elements
in a Java Server Page will generally be compiled by the JSP
engine into a servlet, but the JSP specification only
requires that the JSP page execution entity follow the
Servlet Protocol.

The advantage of Java Server Pages is that they are
document-centric. Servlets, on the other hand, look and act
like programs. A Java Server Page can contain Java program
fragments that instantiate and execute Java classes, but
these occur inside an HTML template file and are primarily
used to generate dynamic content. Some of the JSP
functionality can be achieved on the client, using
JavaScript. The power of JSP is that it is server-based and
provides a framework for Web application development. Rather
than choosing between servlets and Java Server Pages, you
will find that most non-trivial applications will want to
use a combination of JSP and servlets. In fact, the JSP 1.1
and Servlet 2.2 specifications are based around the concept
of the Web application, combining the two APIs into a
unified framework.
(http://www.devx.com/tips/Tip/25217)

Is This Answer Correct ?    5 Yes 2 No

What is the difference between jsp and servlet?..

Answer / dimpu

>Servlets are gud at running logic.
>not so gud at producing large amount of o/p.

>Not so gud at lots of logic.
>g8 ay producing lots of texual o/p.

Is This Answer Correct ?    3 Yes 4 No

What is the difference between jsp and servlet?..

Answer / mahesh

Jsp is defined as Java server pages.
Jsp and servlet both are server side programming language.
the diffence in b/w these two is Jsp is used for
presentation part and servlet is use to give the business
logic.
Servlet act as redirector also. it redirect your page as
per the business logic.

anyhow Jsp are compiled to servlet but Jsp comes in to
picture to separate out the presentation logic from the
servlet to make it loosely coupled.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Core Java Interview Questions

What are other modifiers?

2 Answers   Wipro,


What is a local block?

0 Answers   Global Logic,


What is the benefit of lambda expressions?

0 Answers  


write a class to input 2 points by the user & check the line maked by the points is horizontal,vertical or rectangle?

1 Answers  


What is charat java?

0 Answers  






Can a final method be overloaded?

0 Answers  


What is string and example?

0 Answers  


How do you write methodology?

0 Answers  


What if I write static public void instead of public static void in java?

0 Answers   Winsol Solutions,


List out five keywords related to exception handling ?

0 Answers  


What is autoboxing and unboxing?

0 Answers  


what is platform native code

2 Answers   i3 Solutions,


Categories