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
Why jsp is better than servlet?
What is cgi?
What is a servlet-to-servlet communcation?
Is servlet a framework?
Write a program to show the functionality of servlets.
When servlet object is created?
What are all the advantages of servlet over cgi?
What do you mean by cgi?
Which event is fired at the time of setting, getting or removing attribute from application scope?
Explain the difference between jsp and servlet?
What are the mechanisms used by a servlet container for maintaining session information?
What do you mean by request dispatcher in servlet? Also explain its methods.
What is meant by cookies?
What is the process to implement doget and dopost methods?
What is a servlet engine?