As suggested by McDowell and BalusC, you can create a converter and register it using the @FacesConvert annotation for the String class. And then in the getAsObject method, check the type of UIComponent and apply trimming only to the HtmlInputText components.
@FacesConverter(forClass = String.class) public class StringTrimConverter implements Serializable, javax.faces.convert.Converter { @Override public Object getAsObject(FacesContext context, UIComponent cmp, String value) { if (value != null && cmp instanceof HtmlInputText) {
koshua
source share