I have a form with several textfields. When I populate it with data, there are some integer textfields which is showing '0', which is the default value for integer. I want the textfield to be blank than a zero.
<s:textfield id="txtPhone" name="phone"/>
Please help.
You need to use Integer class and not int for that. int will always be initialized to 0.
S2 OGNL and type convertor will take care of type conversion for you.
For Integer default will be null and it will solve your issue.
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