SendRedirect

SendRedirect
  • The sendRedirect() method of HttpServletResponse interface can be used to redirect response to another resource, it may be servlet, JSP or HTML file.
  • It accepts relative as well as absolute URL.
  • It works at the client side because it uses the URL bar of the browser to make another request. So, it can work inside and outside the server.
  • Syntax:
public void sendRedirect(String URL)throws IOException;
  • Example:
resp.sendRedirect("http://profcdpatel.blogspot.com");
  • How to create a custom search engine?
    • Step 01: Create index.html page.
    • Step 02: Create search.java servlet file.
    • Step 03: Run index.html page.
    • Step 04: See the output.

Thanks a lot for query or your valuable suggestions related to the topic.

Previous Post Next Post

Contact Form