No result defined for action X and result YHTTP Status 500 - Could not find action or result
encodingFilter
org.springframework.web.filter.CharacterEncodingFilter
encoding
UTF-8
forceEncoding
true
encodingFilter
/*
struts2
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
struts2
/*
REQUEST
FORWARD
INCLUDE
hibernateFilter
org.springframework.orm.hibernate5.support.OpenSessionInViewFilter
hibernateFilter
/*
/jsp/home.jsp
訪問路徑必須為:https://host:port/context/user/login.action(注意 /user 來自 namespace)
/jsp/home.jsp
/jsp/home.jsp
/jsp/home.jsp
/jsp/user/list.jsp
/jsp/user/add.jsp
若 JSP 中訪問懶加載關聯,且 Session 已關閉,會拋出 LazyInitializationException。若全局異常處理未配置,可能表現為空白頁。
Hibernate.initialize(entity.getCollection()))@Transactional(readOnly=true) 確保事務範圍覆蓋視圖渲染web.xml 中 <error-page> 或 Struts2 global-resultsweb.xml 過濾器順序:Encoding → Struts2 → Spring/Hibernatefilter-mapping 包含 FORWARD dispatcherstruts.xml namespace 與 URL 路徑一致struts.convention.package.locators)/ 開頭(相對 Web 根目錄)localhost.yyyy-mm-dd.log)
# 1. 開啟 Struts2 開發模式(struts.properties)
struts.devMode = true
struts.i18n.reload = true
# 2. 訪問 action 後檢查控制台輸出
# 關鍵日誌:[DEBUG] ... mapping.ActionMapper - Mapping request URI to action
# 3. 直接訪問 JSP 路徑驗證頁面本身無誤
https://host:port/context/jsp/home.jsp