I'm using Spring and I want to set a property only if the value passed is not null?
I tried this example but it doesn't work. I want to add the property only if it is not null else not add it. I don't want to add a default value. Thanks for your help
<util:properties id="mailProperties" location="classpath:mail.properties"/>
<property name="javaMailProperties">
<props>
<prop key="mail.smtp.starttls.enable">#{mailProperties['mail.smtp.starttls.enable']:''}</prop>
</props>
</property>