What is the difference between JSP and Servlet?

Answer Posted / ranjan satapathy

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.

Is This Answer Correct ?    77 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do we configure init params for jsp?

516


What are the lifecycle phases of a jsp?

550


What is a output comment?

558


Is jsp front end or backend?

498


What is include directive in jsp?

497






Why is used in jsp?

493


What does jsp mean?

504


Why is jsp used for?

498


Is it possible to share an httpsession between a jsp and ejb? What happens when I change a value in the httpsession from inside an ejb?

509


What is translation phase?

573


How to include static files in a jsp?

511


What is a jsp container?

494


What is the jsp?

545


Why is _jspservice() method starting with an '_' while other life cycle methods do not?

513


How to deactivate el usage on jsp?

524