MyEclipse Struts Config Editor打开struts-config.xml时错误的解决方法

  最近几天在MyEclipse中建立工程时,没有使用MyEclipse中的Add Struts Capabilities来加入Struts支持,而是手工进行了配置。

  1、将Struts所需的jar文件copy到WEB-INF/lib目录下

  2、在工程中新建了一个名为"config"的Source Folder,在此文件夹中建立Struts的配置文件struts-config.xml

  3、修改WEB-INF目录下的web.xml

 

 

  然后双击struts-config.xml,准备进行修改,但此时发现默认的MyEclipse Struts Config Editor编辑器打开该文件时出现错误:“org.eclipse.ui.PartInitException: Project newsjq is not configured as a MyEclipse Web-Struts Project. Therefore the MyEclipse Struts Editor may not be used with struts-config.xml. The default XML Editor has been used to open the file instead. ”,此时MyEclipse默认用其MyEclipse XML Editor打开该文件了。

  如何解决这个问题呢?在网上搜索了一下,发现网友巴士飞扬的博客上有一个方法非常有效,用编辑器打开该工程文件夹下的.project文件,在<natures></natures>之间增加一个<nature>com.genuitec.eclipse.cross.easystruts.eclipse.easystrutsnature</nature>配置即可。

 

 

  然后就可以用MyEclipse Struts Config Editor打开该struts-config.xml文件了,这时会在struts-config.xml所在的文件夹(这里为config)下产生一个.struts-config.mex文件,这样在MyEclipse Struts Config Editor中就可以使用其Design视图模式了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

learnlife

向这个世界输出我独有的声音。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值