新建一个web project:hello-struts

1.拷贝struts的jar包到项目中(apps中的blank项目中可以找到这些jar包)

2.讲struts2的过滤器拷贝到web.xml中

3.配置struts2的配置文件(在src目录中创建struts.xml文件)

4.创建action(action就是一个POJO类)

- 4.1 为action编写execute方法
public String execute(){
System.out.println("Hello struts.");
return "success";
}- 4.2 在struts.xml文件中配置action和返回结果集
<action name="hello" class="net.qbzhong.action.HelloAction"
method="execute">
<result name="success">/hello.jsp</result>
</action>直接运行,进入index.jsp页面

在地址栏后面加上hello,进入hello.jsp



