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

TCK Challenge: <f:metadata> must be a child of <f:view> #1705

Closed
brideck opened this issue Oct 12, 2022 · 3 comments
Closed

TCK Challenge: <f:metadata> must be a child of <f:view> #1705

brideck opened this issue Oct 12, 2022 · 3 comments
Labels
accepted Accepted certification request challenge TCK challenge pr-available

Comments

@brideck
Copy link
Contributor

brideck commented Oct 12, 2022

Challenged Tests:
ee.jakarta.tck.faces.test.javaee7.protectedview.Bug22995287IT

TCK Version:
Jakarta Faces 4.0.x

Tested Implementation:
Open Liberty -- containing MyFaces 4.0

Description:
The VDL doc for <f:metadata> states "This must be a child of the <f:view>." However, Page2 and Page3 in this test application both have it as a child of the <h:head> instead.

The specification is silent on what exactly is supposed to happen when this stipulation of the spec is violated. As pointed out in a Mojarra issue, MyFaces throws an exception in this case and Mojarra allows it. Accordingly, these tests fail for us with exceptions like the following:

Caused by: jakarta.faces.view.facelets.TagException: /page3.xhtml at line 31 and column 14 <f:metadata> Parent UIComponent j_id_5 should be instance of UIViewRoot
    at org.apache.myfaces.view.facelets.tag.faces.core.ViewMetadataHandler.apply(ViewMetadataHandler.java:60)
    at jakarta.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
    at jakarta.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:57)
    at org.apache.myfaces.view.facelets.tag.faces.ComponentTagHandlerDelegate.apply(ComponentTagHandlerDelegate.java:362)
    at jakarta.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:52)
    at jakarta.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
    at org.apache.myfaces.view.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:67)
    at jakarta.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
    at jakarta.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
    at jakarta.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
    at org.apache.myfaces.view.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:49)
    at org.apache.myfaces.view.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:195)
    at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.buildView(FaceletViewDeclarationLanguage.java:423)
    at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:83)
    at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:241)
    ...

The consensus in the Mojarra issue seems to be that MyFaces behavior is the better one in this instance. Regardless, the TCK application should be rewritten in order to be in compliance with the specification.

@pnicolucci pnicolucci added the challenge TCK challenge label Oct 12, 2022
@pnicolucci
Copy link
Contributor

From my point of view, this is a valid challenge. @arjantijms @BalusC @tandraschko do you agree?

@pnicolucci
Copy link
Contributor

@arjantijms @BalusC I wanted to call attention to this one and get your thoughts. Thanks!

@BalusC
Copy link
Member

BalusC commented Nov 4, 2022

Valid.

And the spec needs to be updated to explicitly say "immediate child" or "direct child" instead of "child".

Because, especially in CSS terminology, f:view -> h:head -> f:metadata still makes the f:metadata a visible child of f:view.

@arjantijms arjantijms added the accepted Accepted certification request label Nov 4, 2022
BalusC added a commit to eclipse-ee4j/mojarra that referenced this issue Nov 24, 2022
Clarified spec wrt location of f:metadata
BalusC added a commit to eclipse-ee4j/mojarra that referenced this issue Nov 24, 2022
BalusC added a commit to eclipse-ee4j/mojarra that referenced this issue Nov 24, 2022
Backport WARNING message into Mojarra 4.0
arjantijms added a commit that referenced this issue Nov 29, 2022
…_must_be_a_child_of_f-view

Fix #1705 f:metadata must be a child of f:view
jasondlee pushed a commit to jboss/mojarra that referenced this issue May 18, 2023
Backport WARNING message into Mojarra 4.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Accepted certification request challenge TCK challenge pr-available
Projects
None yet
Development

No branches or pull requests

4 participants