Monday, 27 June 2016

How to redirect an HTTP request to another URL ?


Method in HttpServletResponse interface
  • sendRedirect(String location)
    sends a temporary redirect response to the client using the specified redirect location URL
    .
    It can accept relative URLs ( without a leading '/'
    ) which must converted to the absolute URL by Servlet container
After using this method, the response should be considered to be committed.
If the response has already been committed, this method throws an IllegalStateException.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.