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:
- Example:
- 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.
Tags:
Java