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 method is called when reference variable is passed in system.net?
What do you mean by default initialization in java servlet?
What is the importance of init() method in Servlet ?
How can a servlet be used to generate plain text instead of html?
What is http servlet? Explain with the help of an example.
Explain the methods of request dispatcher in servlet?
What are different methods of session management in servlets?
How do we translate jsp?
Explain is servlet mapping?
What is a deployment descriptor?
How do you design microservices?
Explain the war file?
What is the difference between Servlets and Applets?
Which method of the httpservletrequest object is used?
Which http method is said to be non-idempotent and idempotent?