I want to pass int instead of string which is default in spring PropertyPlaceholderConfigurer.
<property name="mailServerPort" value="${mail.port}" />
This give me error because mailServerPort is int type and ${mail.port} is string type.
How can I convert ${mail.port} to int?
According to me the casting should work properly if the value of port is proper integer.
Still if you face the problem you can try SpringExpressionLanguage(SpEL) for conversion.
<property name="mailServerPort" value="#{ T(java.lang.Integer).parseInt(mail.port) }"/>
Hope this helps you.
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