31.2. Annotations
Seam also provides annotations to let you use Seam components as JSF converters and validators:
-
@Converter Copy to Clipboard Copied! Toggle word wrap Toggle overflow <h:inputText value="#{shop.item}" converter="itemConverter" /><h:inputText value="#{shop.item}" converter="itemConverter" />Copy to Clipboard Copied! Toggle word wrap Toggle overflow Registers the Seam component as a JSF converter. Here, the converter accesses the JPA EntityManager inside a JTA transaction when converting the value back to its object representation.-
@Validator Copy to Clipboard Copied! Toggle word wrap Toggle overflow <h:inputText value="#{shop.item}" validator="itemValidator" /><h:inputText value="#{shop.item}" validator="itemValidator" />Copy to Clipboard Copied! Toggle word wrap Toggle overflow Registers the Seam component as a JSF validator. Here, the validator injects another Seam component; the injected component is used to validate the value.