編輯struts.xml等檔案時,一般是沒有文法提示的,可以進行設定,方式如下:
拷貝struts2-core-2.X.jar中的struts-2.3.dtd檔案,放置任意位置,比如D:\Src_API\下;
打開MyEclipse的window/preferences,輸入框鍵入 XML catalog,如下圖:
點選”Add”按鈕,打開如下對話框:
Location選擇 dtd檔案的放置位置;
Key Type選擇URI;
拷貝struts.xml檔案的 <!DOCTYPE /> 标簽的如下文本: http://struts.apache.org/dtds/struts-2.3.dtd
粘貼到Key中;
儲存,即可有文法提示。