1.创建Web Project
File->new->Web Project
2.输入Project Name,Finsh
Struts2_0100_Introduction //这样写是为方便中间插入其他项目
Java EE 5.0 //选择高版本
3.配置Tomcat
Window->Preferences->MyEclipse->Servers->Tomcat 6.x 配置Tomcat的目录
4.配置JDK
Window->Preferences->Java->Installed JREs 选择JDK的目录
5.Finish
6.Copy struts.xml
struts.xml为所下载的struts2中的app中的配置文件,copy到src目录下
7.Copy lib
lib中的类库为所下载的struts2中的app中lib文件下的类库,copy到WebRoot->WebInfo->lib
8.配置web.xml
copy已有的web.xml中的filter部分:
<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>
9.运行