我想配置验证表达式类型以验证四个字段的总和不超过100
<validator type="expression" short-circuit="true">
<param name="expression">
(employee.analysis + employee.development + employee.test + employee.maintenance) gt 100
</param>
<message key="validations.error.total"/>
</validator>
但上述解决方案并不起作用
我也试过这个:
<validator type="expression" short-circuit="true">
<param name="expression">
<![CDATA[(employee.analysis + employee.development + employee.test + employee.maintenance) > 100 ]]>
</param>
<message key="validations.error.total"/>
</validator>
答案 0 :(得分:0)
解决方案就是:
<validator type="expression" short-circuit="true">
<param name="expression">
<![CDATA[(employee.analysis + employee.development + employee.test + employee.maintenance) <= 100 ]]>
</param>
<message key="validations.error.total"/>
</validator>