1、準備工作
http://struts.apache.org/下載最新版本的Struts包,并解壓縮到自己的工作目錄。(這里以struts-2.2.1為例)

2、新建一個新的動態Web Project,到struts-2.2.1\apps文件夾里將struts2-blank-2.2.1.war文件解壓縮,復制struts2-blank-2.2.1\WEB-INF文件夾里面的web.xml文件到本項目的WEB-INF文件夾里。
到struts2-blank-2.2.1\WEB-INF\classes文件夾里將struts.xml文件復制到本項目的src文件夾里。
到struts2-blank-2.2.1\WEB-INF\lib文件夾里將所有的文件復制到本項目的WEB-INF\lib文件夾里。
文件目錄結構如下所示:

隨便寫了一個Hello.jsp文件,里面顯示Hello World!
3、修改配置文件
struts.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd"
>

<struts>
    
<constant name="struts.devMode" value="true" /><!--打開開發模式,便于調試-->
    
<package name="default" namespace="/" extends="struts-default">
        
<action name="hello">
            
<result>
                /Hello.jsp
            
</result>
        
</action>
    
</package>
</struts>
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

    
<display-name>Struts Blank</display-name>

    
<filter>
        
<filter-name>struts2</filter-name>
        
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
    
</filter>

    
<filter-mapping>
        
<filter-name>struts2</filter-name>
        
<url-pattern>/*</url-pattern>
    
</filter-mapping>

    
<welcome-file-list>
        
<welcome-file>index.html</welcome-file>
    
</welcome-file-list>

</web-app>
配置完成后,將本項目布署到Tomcat上,在瀏覽器里輸入
http://localhost:8080/Struts2_0100_Introduction/hello
如果配置都正確,則會顯示Hello.jsp文件里的內容。