waht is the main diference b/w servelts and JSP ?




Answers were Sorted based on User's Feedback



waht is the main diference b/w servelts and JSP ?..

Answer / vaibhav

The major difference is that JSP files are dynamically
compiled at the time of request whereas the servlets had to
be compiled before the server is started. Evrytime the file
is modified, it is to be compiled manually and the server
needs to be restarted. This does not happen in JSp where
files are automatically compiled at the time of request and
the server need not be restarted.

Is This Answer Correct ?    17 Yes 2 No

waht is the main diference b/w servelts and JSP ?..

Answer / anurag joseph

there are minor difference btw these two.Servlet is used
for processing afterall containter is servlet engine.It
perform many task like load balancing,request
processing,generating image on fly.But if we want to
responce an html format than this is not efficient.thats
why jsp is needed.jsp is java inside Html and servlet is
like html inside java.JSP is used for graphical user
interface. it focus upon presentation not business logic
and processing.

Is This Answer Correct ?    11 Yes 3 No

waht is the main diference b/w servelts and JSP ?..

Answer / shakir khan

In terms of creating a Grapical user interface,servlet is
tough to use.Because you have to write huge code to send
html text to client.This is automatically done for you,when
you write a JSP,Using its tags etc.You can check the
generated servlet and try to judge the code you didn't have
to write.

In servlet using OutputStream,we can send byte streamS like
images.or
We can use customized OutputStream and do whatever we can
with it.Whereas with JSP we can output only
characters.Since PrintWriter is character based.

The advantage of JSP is that they are documentric servlets
look and act like programs.

The power of jsp is that they are server based and provides
a framework for web based application.

JSP is a flat file that are translated at runtime in to a
servlet.JSP are useful for presentation oriented task such
as html rendering.

JSP are high level extension of servlet,it enable the
developer to embed java code in html pages.JSP pages are
finally complied in to a servlet.Complied servlet is used
by the engine to serve the request.

Is This Answer Correct ?    7 Yes 0 No




waht is the main diference b/w servelts and JSP ?..

Answer / ravindra nhavi

the main different is jsp only depend on HTTP protocol
but servlet support for HTTP,SMTP,FTP protocol

In jsp you directly embeded java code in to the html code
but is in servlet is not posible.

Is This Answer Correct ?    5 Yes 0 No

waht is the main diference b/w servelts and JSP ?..

Answer / nagababu

By using jsp we can seperate presentation logic from
bussinesslogic

By Using Servlets combine presentation logic and business
logic.

Is This Answer Correct ?    3 Yes 0 No

waht is the main diference b/w servelts and JSP ?..

Answer / surendra

Jsp is nothing but a servlet
By using jsp we can seperate presentation logic from
bussinesslogic
The report that generate to the enduser must be placed in
jsppage
All the database operations must be placed in a javabean
so that we can easily modify the application if required
To simplify the development of the application jsp is used
rather than servlets.

Is This Answer Correct ?    3 Yes 2 No

waht is the main diference b/w servelts and JSP ?..

Answer / amit kmar

Servlets are pure java programs.here we can't use HTML.
But in JSP we use HTML,so we can use and modify the data
very easily.
Servlets are faster than JSP.bcoz while running JSP
programs it will be converted into Servlets and then
executed,so it takes more time.

Is This Answer Correct ?    1 Yes 0 No

waht is the main diference b/w servelts and JSP ?..

Answer / adnan zaman

In servelts html code write with print.out statement every line it is not easy but in jsp html code simple and easy write jsp better then servlets

Is This Answer Correct ?    0 Yes 2 No

Post New Answer



More Servlets Interview Questions

can we create more than ServletContext and ServletConfig in your application

6 Answers   Patni,


What is the role of the webserver?

4 Answers  


Hi Frieds, I am new to servlet why to use servlet in webapplication. what i know is " use servlet as a controller in mvc and to implemnent business logic . is it correct ? One more thing reason for implementing business logic with servlets , why not jsp.

4 Answers  


waht is the main diference b/w servelts and JSP ?

8 Answers   HCL, CAP,


When Servlet is unloaded?

0 Answers  






What method is used to create database connection in servlets?

2 Answers  


Why session tracking is needed?

0 Answers  


What are common tasks performed by Servlet Container?

0 Answers  


If you want to modify the servlet,will the Webserver need to be ShutDown ?

9 Answers  


which method in doGet or doPost is use to send binary date to server

2 Answers   HCL,


What is called a session?

0 Answers  


i have 500 jsp in my application ,with same forward name,it lokks for appropritae jsp from 1 to 500,but i want to send response to 498 page,what should i do

2 Answers   Caritor, Globerian,






Categories