---
title: "struts1: ForwardAction example"
author: "四书五经"
date: "2013-04-04T17:31:12Z"
tags: []
categories: ["企业架构"]
slug: "struts1-forwardaction-example"
draft: false
lastmod: "2013-04-04T17:33:51Z"
id: 1842054
url: "https://coderanch.iteye.com/blog/1842054"
---

**1st.  create simple web app**

mvn archetype:create -DgroupId=*com.iteye.struts1* -DartifactId=*struts1* -DarchetypeArtifactId=**maven**

**-archetype-webapp**

 

**2nd. update pom.xml**

```
...
<dependency>
      <groupId>org.apache.struts</groupId>
 <artifactId>struts-core</artifactId>
      <version>1.3.10</version>
    </dependency>
 
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts-extras</artifactId>
<version>1.3.10</version>
</dependency>
    <dependency>
      <groupId>org.apache.struts</groupId>
 <artifactId>struts-taglib</artifactId>
      <version>1.3.10</version>
    </dependency>
    <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
    </dependency>
...
```

 

**3rd:**

add index.jsp:

 

```
<html:link page="/welcome.do">
click me to access to welcome page
</html:link>
```

 

 

add welcome.jsp:

 

 

```
<html>
<head></head>
<body>
<h1>This is Welcome Page</h1><br>
<%
java.util.Date date = new java.util.Date();
%>
<%=date %>
</body>
</html>
```

 

 

**4th:**

   
![](http://dl.iteye.com/upload/attachment/0082/6720/6ffed5f8-39c8-36f1-9060-69bdf1141225.jpg)  
![](http://dl.iteye.com/upload/attachment/0082/6722/a3e11d9b-afa2-3581-86dc-4aa1a6e5a0ca.jpg)