For converting String values in JSF bean validation, which converter will be used? Like for numeric values we use <f:convertNumber> and for date we use <f:convertDataTime>. My code snipest are as follows:
The purpose of converters is to transform non-string objects to and from string form because HTML is a text-only format but that isn't supposed to limit what kinds of objects users can work with. So there is no converter for strings,
Validation annotations are useful things. They can be set on the primary definition of a data object to ensure that data will be conformant to basic edit requirements regardless of who sets it. However, they're not the only solution to that problem, and sometimes there's even a benefit to having multiple solutions.
For example, the "required="true"" JSF attribute can be used as a front-end check for required data. That will allow JSF to pre-screen the value early in the lifecycle, which allows the twin benefits of short-circuiting around useless work as well as benefiting from the JSF-standard error mechanisms.
For input text controls, things can go even further. By using the maxlength attribute, the generated HTML control will possess the ability to block entry of values longer than that limit at the user data-entry level. In other words, the client software itself (web browser) enforces the restriction.
An IDE is no substitute for an Intelligent Developer.