2017-03-17 51 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"/> 
相关问题