waht is the main diference b/w servelts and JSP ?
Answer Posted / 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 |
Post New Answer View All Answers
What are the different types of servlets?
What’s the difference between genericservlet and httpservlet?
What do you mean by servlet?
What if we pass negative value in load-on-startup?
What is the difference between get and post methods?
Why session tracking is needed?
Why is a constructor needed in a servlet even if we use the init method?
List out difference between a JavaBean from a Servlet?
If some new data has entered the database, explain how can a servlet refresh automatically?
what is the different between a servlet and a cgi? Why do you go for servlet rather than cgi?
how many jsp scripting elements are there and what are those?
What are the exceptions thrown by servlets? Why?
Define the life cycle of a servlets.
What is generic servlet class?
Which is better jsp or servlet?