欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  科技

MyEclipse中配置struts2.2.1的方法

程序员文章站 2023-01-09 08:30:55
MyEclipse中配置struts2.2.1的方法...

1,首先就是要建立一个web project项目
2,设置jdk和servers路径,如果jdk和servers已经配置ok,跳过这一步骤。
在菜单中的window选项中配置jdk和servers
对于jdk,点击java-.>找到jre那个东西,然后输入你的jdk安装目录
对于servers,点击myeclipse中的servers中的tomcat,一定记得要选择上面的enable
然后,在找到你的安装地方
3,配置struts

一共要做四件事

第一个

首先就是在你的struts2解压的包中找到apps/struts2-blank-2.2.1.war/web-inf
/classes/struts.xml复制到你的myeclipse项目中的src中,然后要进行修改

第二件

在刚才的那个目录下将其lib中的类库文件全部复制到你的myeclipse/lib种就行了。

第三件

在你的项目中从刚才的目录下的web-xml中复制下面东西到你的web-xml里
<web-app id=webapp_9 xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4" < p>
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">
struts blank
struts2
org.apache.struts2.dispatcher.ng.filter.strutsprepareandexecutefilter
struts2
/*

第四件

修改你的struts2的配置文件也就是struts.xml,记得将其中的东西都删除或者注释

"-//apache software foundation//dtd struts configuration 2.0//en"
"http://struts.apache.org/dtds/struts-2.0.dtd">
/upload.jsp

/upload
/succ.jsp

相关标签: Myeclipse Struts