可以在struts.xml中指定任何struts属性吗?

时间:2017-03-17 22:21:24

标签: struts2

struts.properties文件中的任何Struts常量也可以在struts.xml中指定吗?这将使我们能够使用环境变量

设置值

例如,属性文件中可以包含以下常量:

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}"/>

1 个答案:

答案 0 :(得分: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"/>
相关问题