MyEclipse The Struts.xml file does not have the code hint function and the addition of the DTD constraint is still invalid after the resolution

Source: Internet
Author: User

First: First try to add struts2 DTD constraints, and some will be added after the save to reopen the code hints.

The concrete steps are as follows: Take struts2-2.3.16 as an example

1. Click Window,preferences,xml Catalog;

2. In the popup dialog box, select the first user, click Add;

3.location for your struts2 src below the core in sequence Src,main,resource, finally select the corresponding STRUTS2 version of the DTD constraint package, my 2.3.16DTD configuration is as follows: D:\Java\ Struts-2.3.16.3\src\core\src\main\resources\struts-2.3.dtd

4. Select the key type as the URL, my key is: HTTP://STRUTS.APACHE.ORG/DTDS/STRUTS-2.3.DTD, the corresponding version of the STRUTS2 to modify

5. Always ok after saving, re-open there may be XML code hints.

If none of the above is the second case:

Second: Many people do not have a hint after the first one, this may be your myeclipse setup problem.

MyEclipse will use the Struts configuration Editor to edit the Struts.xml file by default, and this editor is a bug, so it's better to change to an XML editor.
The steps are as follows:
Window->preferences->general->editors, click on the ' File associations ' link above
Find "*.xml" in the box above, select "MyEclipse XML Editor" in the box below and click "Default Button", then click "OK".

After this setting you will find that your struts.xml becomes the style opened in XML Editor, and when you reopen it, input < will automatically have code hints.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.