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
What are the two important api's in for servlets?
What is the difference between forward () and sendredirect () functions in servlet? Explain
Explain load on start-up and its importance?
What is servlet interface?
When Servlet is unloaded?
Why do we have servlet listeners?
what is servlet chaining?
What is lazy loading and what is Generic Servlet Class?
What is session?
List out the difference between ServletConfig and ServletContext?
Explain the servlet filter.
How to get the path of servlet in the server?
What is meant by a servlet?
How do you configure a centralized error handler in servlets?
Explain the custom jsp tags and the beans.