By candid | Posted :
Mar 21, 2016
| Updated :
Mar 21, 2016
Sends a redirect response to the client using the specified redirect location URL. The url passed to this method should be relative.
SendRedirect method should be executed only once pre response object, If you try to call this method twice using same response it will throw the message "response has already been committed"
response.sendRedirect("relative_url");
Key points
1. We cannot send post request using redirect
2. While redirecting a page request and response object from the current page will killed
3. New request and response will be created for newly loaded or redirected page page
4. We can use both relative and absolute url with sendRedirect
Example: response.sendRedirect("ui/index.htnl") or response.sendRedirect("http://....../ui/index.htnl")