1. 程式人生 > >Myeclipse建立struts.xml

Myeclipse建立struts.xml

因為在myeclipse中編寫struts.xml檔案時"alt+/ "不支援提示,所以我們需要新增dtd的支援

準備步驟1-2,

1,首先我們需要struts2的核心jar包struts2-core.jar(如果沒有可以去下載)

2,解壓struts2-core.jar,可得到一個名為struts2-core的資料夾,在該資料夾下找到struts-2.3.dtd

3.用記事本或者別的文件編輯器開啟struts2.3.tdt

4.在Myeclipse中選單欄window->preference->Myeclipse->file and eiditor->xml->xml catalog 點選add,

location 中就選擇之前找到的struts2.3.dtd, key type選擇預設的public id ,key複製struts2.3.dtd

中第一行引號中的內容,勾上alternative web address,下面的輸入框內複製第二行引號中的內容.

配置tdt完之後就可以建立struts.xml了,步驟如下

1,右鍵專案名---new---xml(basic templates)---file name 改為struts.xml---next---選擇第一個------next-----選擇第二個

然後選擇自己新增的dtd檔案

next-----finish