this is small part of my context:
<property name="a" value="1"/> where a is Integer.
How I can set null to this value ?
You can use the element <null/>
to indicate a null value:
<property name="a" value="1"/><null/></property>
Edit: There is more information in the official spring 2.5 documentation here: http://static.springsource.org/spring/docs/2.5.x/reference/beans.html#beans-null-element
There is the way to set the null value in the Spring configuration file.
Spring:
<bean class="SampleBean">
<property name="name"><value></value></property>
</bean>
Results in the name property being set to "", equivalent to the java code: sampleBean.setName("").
The special <null>
element may be used to indicate a null value, so that:
Spring:
<bean class="ExampleBean">
<property name="email"><null/></property>
</bean>
The above configuration is equivalent to the java code:
Java:
exampleBean.setEmail(null).
See this link: http://www.java-forums.org/java-tip/3218-how-set-null-value-springs-configuration-file.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With