JSP – Forward Action Tags

Jsp:Forward Action Tag

  • jsp:forward action tag is used for controlling the page flow.
  • It forwards the request from a JSP to the other resource.
  • Another resource can be servlet, jsp or html file.

Syntax:

<jsp:forward page=”URL of other resource”/>

welcome.jsp:

<html>
            <head>
                        <title>forward action example</title>
            </head>
            <body>
                        <jsp:forward page=”home.jsp”/>
            </body>
</html>

home.jsp:

<html>
            <head>
                        <title>forward action example</title>
            </head>
            <body>
                        <h4>This content is of that resource on which request is forwarded.</h4>
            </body>
</html>
Scroll to Top