2017-03-17 53 views
1

struts.properties文件中的任何Struts常量是否也可以在struts.xml中指定?這將使我們能夠與設置環境變量是否可以在struts.xml中指定任何struts屬性?

例如,可以在屬性以下常量文件中的值:

struts.ognl.logMissingProperties=true 
struts.el.throwExceptionOnFailure=false 

struts.xml爲以下改爲指定?

<constant name="struts.ognl.logMissingProperties" value="${env.logmissing}"/> 
<constant name="struts.el.throwExceptionOnFailure" value="${env.throwExc}"/> 

回答

0

struts.properties配置屬性可以struts.xml指定。如果您沒有struts.xml,則可以使用第一個文件更改全局屬性。

因此,從struts.properties文件的屬性將是struts.xml

<constant name="struts.ognl.logMissingProperties" value="true"/> 
<constant name="struts.el.throwExceptionOnFailure" value="false"/> 
相關問題