官方的struct.xml 示例中,如果要切換為開發模式,往往是要在<struct>中加下以下内容
<constant name="struts.devMode" value="true"/>
但這麼改了之後卻發現,我每次更改了struct2的配置檔案後,還是必須要重新開機tomcat才會生效
經過研究發現,如果改成
<constant name="struts.configuration.xml.reload" value="true"/>
就可以了。
下面是4個開發模式常用配置的簡介---
<!-- 開啟使用開發模式,詳細錯誤提示 -->
<!-- <constant name="struts.devMode" value="true"/>-->
<!-- 指定每次請求到達,重新加載資源檔案 -->
<!-- <constant name="struts.i18n.reload" value="true"/>-->
<!-- 指定每次配置檔案更改後,自動重新加載 -->
<!-- <constant name="struts.configuration.xml.reload" value="true"/>-->
<!-- 指定XSLT Result使用樣式表緩存 -->
<!-- <constant name="struts.xslt.nocache" value="true"/>-->