Reputation: 1539
I want to convert the text entered by someone into a textbox into a double(for example), and automatically set up the value of an bean field with that double.
Upvotes: 0
Views: 366
Reputation: 597124
javax.faces.convert.Converter
getAsString(..)
method use object.toString()
getAsObject(..)
method use new BigDecimal(str)
/ Double.parseDouble(str)
/ Integer.parseInt(str)
. Use instanceof
to differentiate between the types.Upvotes: 1