Difference between Include, Forward and sendRedirect in
Servlet?
Answer Posted / samit katiyar
forward() should be called before the response has been
committed to the client (before response body output has
been flushed). If the response already has been committed,
this method throws an IllegalStateException. Uncommitted
output in the response buffer is automatically cleared
before the forward.
While with include()...... The request and response
parameters must be either the same objects as were passed
to the calling servlet's service method or be subclasses of
the ServletRequestWrapper or ServletResponseWrapper classes
that wrap them.
| Is This Answer Correct ? | 8 Yes | 3 No |
Post New Answer View All Answers
Which is better jsp or servlet?
What is the directory structure of web application?
What is generic servlet class?
How can the referrer and the target urls be used in servlet?
Why is a constructor needed in a servlet even if we use the init method?
How would you create deadlock on your servlet?
What are the functions of an intercepting filter?
How can we refresh automatically when new data has entered the database?
Whether we can get deadlock situation in servlets?
What are the steps that are required to handle the multi-threading?
What is the effective way to make sure all the servlets are accessible only when user has a valid session?
Write a command to get actual path of a servlet to the server?
Can you send an authentication error from a servlet?
What is the difference between Server and Container?
What is servlet container. how it works?