首頁要做重定向,
public String index() {
return "index";
}
.struts2.dispatcher.Dispatcher - Exception occurred during processing request: There is no Action mapped for action name format.
There is no Action mapped for action name format. - [unknown location]
解決方法是根據git diff找到代碼修改,將result改爲global-result試一下
<global-results>
<result name="index" type="redirect">your url address, better with https on head</result>
</global-results>
本地啓動無錯誤,然後在線上tomcat啓動,又出錯,還是同樣的錯誤!到底咋回事?
直接問搜索引擎吧,其實我們真的不該用struts了,直接spring MVC搞定多好。
可是仍然無果
最終發現了,公司的系統在war包發佈並啓動後,會自動檢查首頁url,因爲redirect的響應是http 302,而公司的系統檢查如果不是200,則發佈失敗!坑爹。