I have a POJO:
public class Foo { public String getValue(Integer arg0, BigDecimal arg1) {...} }
I put it as a model parameter from Spring MVC in JSP and try to use it:
<c:set var="ans" value="${foo.getValue(null, null)}"/>
But in the getValue method
arg0 = 0 arg1 = 0
instead of the expected
arg0 = null arg1 = null
I tried to launch it on Tomcat 7.0.40 and on berth 9.0.3
Is this some kind of Tomcat bug, or is this the correct way EL works? How can I call a method with null parameters in EL?
Update 1: Several sources and documentation ( http://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html ) say that adding a JVM property
-Dorg.apache.el.parser.COERCE_TO_ZERO=false
solves it.
But when I install it, nothing happens. I installed it correctly
System.getProperty("org.apache.el.parser.COERCE_TO_ZERO")`
returns "false" at runtime)
Maybe Tomcat needs some other tweaks to change this setting ...
java spring-mvc tomcat el
vadim_shb
source share