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.
Servlets are pure java codes,here we can't used HTML.
But in JSP we can use HTML,so we can modify and also
updated the data.
Another difference In Servlet clientside validation is
possible But in jsp clientside validation is not possible.
Both servlet and jsp are web components. But servlet is
best suited for request processing, handling the business
logic while jsp is suitable for content generating .Its
easy to include html tag in jsp rather than servlet.Also
jsp is compiled to servlet when first loaded to
webserver.So in many framework servlet act as a controller
while jsp as a view.Also implicit object and action
elements available in jsp but not in servlet.
Jsp is better for preparing presentation pages, while
servlet is good for request processing as it's more
difficult to write include, forward a static or dynamic url
with in out.println() ,
Jsp has also all implicit objects, we need not have to
instantiate any which is easier.
error handelling is easy in jsp isErrorPage="true"
errorPage="/page"
we need not have to bother about init(),service(),destroy
(),doGet(),doPost()in jsp.
in servlet for each time changing we have to explicitly
compile it.
Jsp automatically compiled by container when we reload the
page.
1-The most important difference is that whenever we do some
changes in a servlet we need to build the application
completely but no need to do the same in case of jsp....
hi i m tannu and i m developing one web site as my project
and i have created one chatting application using applet
and socket it run perfactly using netbeans5.5 and
appletviewer but when i run on browser it doent run i put
it class file in jar file then call by jsp when it load in
browser it stop on applet started plz help me soon