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

Can I declare a java class in jsp?

502


Java Server Page I can use a function in two ways: Either I declare or I declare <%@ page import = "mypack.mysubpack.MyClass" %> In each case I can call a function later by coding MyClass.myFunction(); So what is the difference between the two variantes? Why are Beans invented if we don't need them because we have the import statement ? please guide me its an humble request to you reader if u know n i'll be thankful to you...........

1693


Explain handling of runtime exceptions.

649


How many jsp implicit objects are there?

493


What is full form of jsp?

506






How clear chache and buffer of opera browser.

1943


Explain pge Directives.

541


Explain how you understand the action tag and jsp action elements.

549


Explain the jsp implicit objects?

525


What is welcome file list?

485


What is a jsp expression?

547


How does jsp engines instantiate tag handler classes instances?

482


Can a subsequent request be accessed with one’s servlet code, if a request attribute is already sent in his jsp?

525


How can my application get to know when a httpsession is removed?

549


What is tld in jsp?

488