-fish.apache.el.parser.COERCE_TO_ZERO for glassfish? [英] -Dorg.apache.el.parser.COERCE_TO_ZERO for glassfish?
问题描述
Glassfish使用不同的EL实现,默认情况下,它的行为与将 -Dorg.apache.el.parser.COERCE_TO_ZERO
设置为 false
在Tomcat和克隆上。
也许你正在寻找下面的JSF上下文参数。
< context-param>
< param-name> javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL< / param-name>
< param-value> true< /参数值>
< / context-param>
请注意,如果您的意图是让JSF设置,Tomcat和克隆甚至需要上述空字符串在 Long $>等原始包装器属性上提交的值为
null
,而不是 0
。 c $ c>,整数
等。
Do we have anything like -Dorg.apache.el.parser.COERCE_TO_ZERO for glassfish also?
No. Glassfish uses a different EL implementation which behaves by default already the same as when you would set -Dorg.apache.el.parser.COERCE_TO_ZERO
to false
on Tomcat and clones.
Perhaps you're looking for the following JSF context parameter.
<context-param>
<param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
<param-value>true</param-value>
</context-param>
Note that the above is even required on Tomcat and clones and well if your intent is to let JSF set empty string submitted values as null
instead of 0
on primitive wrapper properties like Long
, Integer
, etc.
这篇关于-fish.apache.el.parser.COERCE_TO_ZERO for glassfish?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!