将eclipse中的struts1项目的导入到myeclipse2014后发现struts-config.xml不能用默认的编辑器打开,报错如下:
Project Struts1Test 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.
解决方法如下:
方法1. 临时解决,在struts-config.xml上右键----->选择openwith----->选择 myeclipse XML Editor。这样就没法使用图形化的界面了。
方法2.项目上右键,选择MyEclipse--->选择Project Facets [Capabilities] ----->选择Install Apache Struts(1.x) Facet
弹出窗口选择对应的struts版本和服务器,我这选择的1.2,如果没有服务器环境可以新建一个。
这个时候会提示:" Servlet named action already exists." ,这个地方是说明你的web.xml中已经有了对应的action配置了
接下来是最关键的地方了,先将web.xml改名为web.xml.bak,再重复上面Install Apache Struts(1.x) Facet的步骤,你会发现这次没有提示错误,直接点击finish