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 is the use of servlet wrapper classes?
What is the need of session tracking in web application?
What is the difference between portlet and servlet?
Explain the features are in servlet 3?
Why the container loads server at the application startup and how?
What is the difference between a generic servlet and http servlet?
Why do you use session tracking in httpservlet?
Is java servlet still used?
What is the use of servletconfig interface?
A client sends requests to two different web components. Both of the components access the session. Will they end up using the same session object or different session ?
What are the types of protocols supported by httpservlet ?
What is cookie? Why is cookie used?
How servlet is created?
How do you load an image in a Servlet?
Explain in brief the directory structure of a web application?