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
How do you get the ip address of the client in servlet?
How do I use cookies to store session state on the client?
What is the dispatcher servlet?
What is a servlet context object?
What are the life cycle methods of a servlet?
Which event is fired at the time of setting, getting or removing attribute from application scope?
A client sends requests to two different web components. Both of the components access the session. Will they end up using the same session object or different session ?
Explain is servlet mapping?
What are the new features added to servlet 2.5?
What do you understand by mime type?
What is called a session?
What are the differences between the servletconfig interface and the servletcontext interface?
What is the use of servlet context?
What are the ways to handle multi-threading in servlets?
What are the two important api's in for servlets?