Convert h:selectBooleanCheckbox value between boolean and String
问题 I have a backing bean containing a field creditCard which can have two string values y or n populated from the DB. I would like to display this in checkbox so that y and n gets converted to boolean . How can I implement it? I can't use a custom converter as getAsString() returns String while rendering the response whereas I need a boolean . 回答1: The <h:selectBooleanCheckbox> component does not support a custom converter. The property has to be a boolean . Period. Best what you can do is to do