1.新建一个Struts2工程

 
2.修改工程的编码utf-8
 
3.导入struts-2.3.1.2\apps\struts2-blank\WEB-INF\lib目录下所有的jar包
 
4.创建一个test.jsp
      测试struts,输出有命名空间的的helloWorldAction:
      <a href="${pageContext.request.contextPath}/base/helloWorldAction.action">测试</a>
      
5.创建一个success.jsp
      测试成功
     
6.创建一个HelloWorldAction
        public class HelloWorldAction{
             public String execute(){
                  ....
                  return SUCCESS;  
             }
        }
7.配置struts.xml文件
        <package name="helloworld" namespace="base" extends="struts-default.xml">
            <action name="helloWorldAction" class="...HelloWorldAction">
                <result>success.jsp</result>
            </action>
       </package>
8.配置web.xml文件
       <filter>
              <filter-name>StrutsPrepareAndExecuteFilter</filter-name>
              <filter-class>org.apache.struts2.dispatcher.ng.filter.
                              StrutsPrepareAndExecuteFilter</filter-class>
      </filter>
      <filter-mapping>
              <filter-name>StrutsPrepareAndExecuteFilter</filter-name>
              <url-pattern>/*</url-pattern>
      </filter-mapping>