Converter and validator components are part of the component tree of the view. This tree is recreated for every request. In other words, the tree lives in the request scope. A common problem in JSF is keeping the state of converters and validators or other components that live in the request scope. In Chapter 6, we created a custom converter that had a configurable separator
property. This separator is part of the state of the converter and is needed in every request. Let’s see how we can adapt that converter to keep this state over multiple requests.
In order to be able to save the state, we have to implement the javax.faces.component.StateHolder
interface, which involves implementing four methods. If we implement these methods, our example converter from Chapter 6 will now look as follows:
package inc.monsters.mias.conversion; import javax.faces.component.StateHolder; // other import omitted public class FoodListConverter implements Converter, ClientConverter...