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

What are Servlets?

609


What are the phases of the servlet life cycle?

623


What is servlet in web technology?

584


What are the common methods that are included in the http servlet class?

586


What is cookie? Why is cookie used?

598






Which interface must be implemented by all servlets?

807


What is servlet container. how it works?

627


What is webservlet?

550


What is the use of httpservletrequestwrapper and httpservletresponsewrapper?

550


Why do we have servlet listeners?

615


What are the uses of servlet

645


Write a program to show the functionality of doget and dopost method?

674


What is servlet configuration?

542


Why doesn’t a servlet include main()? How does it work?

647


What is the advantage of Servlets when compared with other server side technologies?

1869