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 servlet and its life cycle?
How we can get ip address of client in servlet?
What is the functionality of actionservlet and requestprocessor?
Define the servlet mapping.
How to get the current httpsession object?
Why do we have servlet filters?
Explain the jar and war files in servlet?
What are the functions of the servlet container?
If my browser does not support cookie, and my server sends a cookie instance what will happen?
What is ServletContext object?
How are filters?
What is the type of method for sending request from http server?
How to read request headers from servlets?
Can we use threads in Servlets?
What is the life cycle of a servlet?