ForwardAction Example in Struts

In my previous hello world program we see that action class is taking the responsibility to forward the request(i.e return ActionForward type object) . Instead of writing  our action class we can use the utility class i.e special Action given by struts famework. i.e org.apache.struts.actions.ForwardAction.

Let us have a small example below.

we didn’t write  any FormBean or Action class in this example.

1. Configure the Maven dependencies in pom.xml


3. Configuration in Struts-config.xml

If you see in the below config file we have configured the org.apache.struts.actions.ForwardAction , what ever the request uri “/” will call this ForwardAction and will reneder the “success.jsp” to the client.

 4. write success.jsp

5. Project structure



Access the url like http://localhost:8080/StrutsForwardExample/




Download  Source Code

Posted in struts and tagged , .

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.