简单讲就这么三步;如果要整合Spring啊,struts2.0标签啊什么 的,这么三步就不够了。那些东西,慢慢写。

1.建立一个Web Project,并且向web-inf/lib中加入所需struts2的五个jar包。(可从apache的官方网站上下载)

struts2-core.jar
xwork.jar
ognl.jar
freemarker.jar
commons-logging.jar

2.配置web.xml

<!--FilterDispatcher类在struts2-core.jar包中-->

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

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

3. 配置struts.xml

<package name="common" extends="struts-default">
<action name="basic" class="common.action.BasicAction">
    <result name="success">index.jsp</result>
   </action>