Configure the dtd in the struts2 configuration file in Myeclipse to support Automatic completion.
If you only need to configure in eclipse, you only need to add in the menu bar window-> preference-> Myeclipse-> file and eiditor-> xml catalog-> add:
Location shows the Location of the selected struts-2.3.dtd
Key Type selected URI
Key: In struts. xml, <! DOCTYPE struts PUBLIC
"-// Apache Software Foundation // DTD Struts Configuration 2.3 // EN"
Select http://struts.apache.org/dtds/struts-2.3.dtd.
If you save the configuration in eclispe, the prompt will automatically appear when you compile the struts. xml file. However, in MyEclipse, you need to change the editor as follows:
For MyEclipse, the XML editor is not set in its default settings, but is set to the xml editor of MyEclipse struts2. Therefore, we need to set the editor corresponding to the xml file
MyEclipse XML editor.
General -----> File Association ----> File types Select *. xml under the associated Editor, select MyEclipse XML Editor, and click the default button to set it to OK by default. Save and exit.