在myeclipse中写struts2的struts.xml配置文件时,没有提示功能,可以这样解决:

1、首先找到你自己在本地存放的struts2的lib目录下找到struts-core-xxx.jar解压开,需要其中的struts-xxx.dtd文件

2、打开你的struts2.xml文件,在开头的

<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">

, 后面的key值就填写 http://struts.apache.org/dtds/struts-2.3.dtd

3、打开window-preferences-myeclipse -files and editors-xml- xml catalog,

点add..,出现一对话框,location栏选file system,找到struts-2.0.14-all\struts-2.0.14\src\core\src\main\resources目录下的struts-2.3.dtd文件,打开,然后key type 选择uri,下面key值填  http://struts.apache.org/dtds/struts-2.3.dtd,点击OK,这样再次打开struts.xml时按alt+/就可以自动显示了。

 4、但是每次都按alt+/,很烦,所以继续配置,打开window-preferences-General-Editors-file associations 在右边找到*.xml,点击*.xml,在下方显示中找到Myeclips XML Editor ,选中,点击default,然后点击OK,再次打开struts.xml 就有提示了