The required flag does not cause any error when left unspecified in a composite or custom tag, even not in development stage. At least in Mojarra. Haven't yet checked MyFaces on this. Not terribly clear what exactly the spec says on this. It appears to be designed for tooling only (IDEs such as Eclipse). Work around for now: use a custom <handler-class> which invokes getRequiredAttribute("foo"); in the constructor.
We should probably clarify Faces spec to explicitly validate them and throw something like a TagAttributeException, at least in Development stage.
Example composite interface:
Example custom tag in
*.taglib.xml
:The
required
flag does not cause any error when left unspecified in a composite or custom tag, even not in development stage. At least in Mojarra. Haven't yet checked MyFaces on this. Not terribly clear what exactly the spec says on this. It appears to be designed for tooling only (IDEs such as Eclipse). Work around for now: use a custom<handler-class>
which invokesgetRequiredAttribute("foo");
in the constructor.We should probably clarify Faces spec to explicitly validate them and throw something like a
TagAttributeException
, at least inDevelopment
stage.WDYT?
cc: @tandraschko