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

Answer Posted / katamraju

Forward():By using forward() method of RequestDispatcher ,ew
can forward a request to a another resource(i.e
servlets,jsp,html....),at finally we can see only called
resource output(i.e second resource output )
For exm. we have two servlets,(servlet1 and servlet2) we are
forwarding request from servlet1 to servlet2, in this case
we can see only servlet2 output.
include():By using include() method of RequestDispatcher we
can forward a request from servlet12 to servlet2 ,in this
case we can see both outputs(i.e servlet1 and servlet2).

in both case single request and single response.

Is This Answer Correct ?    41 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

List out the difference between ServletConfig and ServletContext?

595


Is servlet a server side scripting language?

546


How will you pass values from HTML page to the servlet?

550


Explain the methods of request dispatcher in servlet?

507


What is a cookie What is the difference between session and cookie

590






Explain the working of service() method of a servlet.

496


Write a hello world program using servlets.

583


What is meant by a web application

533


Which interface must be implemented by all servlets?

787


What are the important functions of filters?

588


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

565


Explain web application directory arrangement?

582


What is java servlet?

604


Explain session tracking and its importance?

540


Why is Servlet so popular?

610