jakartaee / faces

Jakarta Faces
Other
109 stars 55 forks source link

required attribute on cc:attribute and taglib.xml is not validated #1904

Open BalusC opened 8 months ago

BalusC commented 8 months ago

Example composite interface:

<cc:attribute name="foo" required="true">

Example custom tag in *.taglib.xml:

<attribute>
    <name>foo</name>
    <required>true</required>
</attribute>

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.

WDYT?

cc: @tandraschko

tandraschko commented 8 months ago

+1 Not sure what we do in MyFaces