Why does allow blank spaces?

That’s normal and natural behaviour and not JSF specific. A blank space may be perfectly valid input. The required=”true” only kicks in on empty inputs, not in filled inputs. In JSF you can however just create a Converter for String class to automatically trim the whitespace. @FacesConverter(forClass=String.class) public class StringTrimmer implements Converter { @Override public … Read more