Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
BalusC opened this issue Mar 6, 2024 · 1 comment
Open

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

BalusC opened this issue Mar 6, 2024 · 1 comment

Comments

@BalusC
Copy link
Member

BalusC commented Mar 6, 2024

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
Copy link

+1
Not sure what we do in MyFaces

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants