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

Why is http protocol called as a stateless protocol?

712


What is servlet and its types?

759


When a servlet accepts a call from a client, it receives two objects. What are they?

971


What is the difference between Server and Container?

840


What is the procedure of invoking different servlet in a different application?

753


What is the use of servletconfig interface?

747


What does the term localization refer to?

762


Explain the servlet filter.

705


Explain web application directory arrangement?

772


What do you mean by httpservlet?

738


What are session variable in servlets?

753


What is servlet looping or chaining?

880


how to link html file to sevlet file.one name is textbox,c&c++ is cheakbox,bc&mca is radio button and one submit buttonis ok why in this programme use in servelt file

2315


What are the differences between the servletconfig interface and the servletcontext interface?

819


Explain the lifecycle of a servlet?

692