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
What are different Authentication options available in Servlets.
What do you mean by request dispatcher in servlet?
What are its drawbacks of cgi?
What are advantages of servlets over cgi?
How can an existing session be invalidated?
Why the concept of single thread model interface is used?
What is servletconfig?
Why is httpservlet declared abstract?
Which exception is thrown if the servlet is not initialized properly?
Why the container loads server at the application startup and how?
Should I override the service() method?
How can a servlet be used to generate plain text instead of html?
What do you mean by a filter and how does it work?
What is servlet attributes and their scope?
how the HTML data stored in web server?