What is forward() and include() of servlets
RequestDispatcher interface?

Answer Posted / ravikiran

forward will make the flow into a different page,where as
include mechanism will include the page to the current
response and continues the flow.
Note:the forward and include should be called before the
response is committed for example before the call to flush()
or flushBuffer() or the write method in the response stream

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the differences between servlet context vs servlet config?

570


What is called Session Tracking?

589


What are life cycle methods of a servlet?

583


Why do we have servlet filters?

590


What is the difference in between the httpservlet and generic servlet?

599






Explain servlet events?

554


Why is servlet used?

674


What are the different ways we can maintain state between requests?

565


Why is init() method is used in servlets?

550


What are the two important api's in for servlets?

580


What are the disadvantages of storing session state in cookies?

621


What is difference between ServletResponse sendRedirect() and RequestDispatcher forward() method?

609


What is the difference between the include() and forward() methods?

563


What is servlet and its use?

621


What are the advantages of Servlet over CGI?

656