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 3 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 ?    1 Yes 2 No

Post New Answer

More Servlets Interview Questions

why we should override only no-agrs init() method.

0 Answers  


What is difference between PrintWriter and ServletOutputStream?

0 Answers  


What exception should be thrown when servlet is not properly initialized?

0 Answers  


Why do we have servlet filters?

0 Answers  


Define declaration.

0 Answers  






What are all the ways for session tracking?

0 Answers  


What do you mean by url pattern in servlet?

0 Answers  


What is ServletContext object?

0 Answers  


What is the difference between Servlet Request and Servlet Context when calling a Request Dispatcher?

0 Answers  


What is servlet instance?

0 Answers  


If some new data has entered the database, explain how can a servlet refresh automatically?

0 Answers   BirlaSoft,


Life Cycle of servlets?

4 Answers   3i Infotech,


Categories