今天第一次搭建struts2框架,跟着網上的教程導入對應的jar包之后就開始寫登錄的jsp頁面,但是運行時出現了問題,
瀏覽器顯示“The requested resource is not available.”的提示。
於是我查看了Console那里,發現有這么一條警告
“Setting property 'source' to 'org.eclipse.jst.jee.server struts2(我的項目名):' did not find a matching property.”
於是乎百度了一下,找到了解決方案
1. server 右鍵——》選擇properties
2.單擊Switch Location,這時,路徑變為如下圖顯示的,保存
3.雙擊server,打開Tomcat v7.0 Server at localhost.server 這個文件,選中publis module context to separate xml file 並保存(保存前先要停止服務器)
最后重啟服務器,運行登錄頁面成功!