Answer Posted / aru
forward is server side redirect and sendRedirect is client
side redirect. When you invoke a forward request, the
request is sent to another resource on the server, without
the client being informed that a different resource is going
to process the request. This process occurs completely with
in the web container And then returns to the calling method.
When a sendRedirect method is invoked, it causes the web
container to return to the browser indicating that a new URL
should be requested. Because the browser issues a completely
new request any object that are stored as request attributes
before the redirect occurs will be lost. This extra round
trip a redirect is slower than forward. Client can disable
sendRedirect.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is the requirement of servlet config and servlet context implemented and how are they implemented?
What is the use of welcome-file-list?
What is the difference between sendredirect() and forward() in a servlet?
If a servlet is not properly initialized, what exception may be thrown?
What are the different methods involved in the process of session management in servlets?
How is a servlet implemented in code?
What is difference between PrintWriter and ServletOutputStream?
What is meant by a web application
Explain the difference between generic servlet and http servlet?
Is it possible to have a constructor inside the servlet?
What are all the protocols supported by httpservlet?
Can you call a jsp from the servlet?
What is the directory structure of a war file?
What is the use of servletconfig interface?
What is the dispatcher servlet?