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
How to find whether a parameter exists in the request object?
What is servlet attributes and their scope?
What is servlet collaboration?
Can you call a jsp from the servlet?
How the typical servlet code look like ?
How to get the current httpsession object?
What is the use of java servlet api?
Should I override the service() method?
What is the use of send redirect () method?
What is the functionality of actionservlet and requestprocessor?
Why don't we write a constructor in a servlet?
Explain the different ways for servlet authentication?
What are some disadvantages of storing session state in cookies?
What do you mean by session tracking and also explain its techniques?
What is servlet api used for conneting database?