-
Notifications
You must be signed in to change notification settings - Fork 117
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
f:metadata and f:view behavior #5105
Comments
Some previous discussion:
|
I personally think its should throw an exception. |
Definitely an exception over silently failing. |
+1 for exception Questions for the future (probably must be discussed in Faces API)
|
@pizzi80 |
yes, all these attributes could be moved to an ipothetic Probably the f:metadata has no sense at all in terms of JSF As stated many time during the last 10+ years JSF is a framework generating HTML, for example:
https://stackoverflow.com/questions/10982762/how-to-generate-json-response-from-jsf In this way it would be possible to create a template or a page in a simpler and more linear way, for example:
|
@pizzi80 that sounds like a JSF spec change and we shouldn't pollute this specific topic with it since this is about the "current" spec and what we should do. You could probably open a Faces Spec ticket. |
created |
I think the difference with two implementations is that MyFaces extends if (! (parent instanceof UIViewRoot) )
{
throw new TagException(this.tag, "Parent UIComponent "+parent.getId()+" should be instance of UIViewRoot");
} But in Mojarra its not a TagHandler so checking for the parent won't be as straighforward as far as I can tell. |
also related to: jakartaee/faces#1466 |
Just saw this PR: #5179 |
Should myfaces also be updated to log a warning, instead of throwing an exception? |
@volosied for consistency i think it should and even log the exact error text of Mojarra so if people look it up on stack overflow etc.? |
The warning log is merely for backwards compatibilty of Mojarra itself because the spec does still not say what should happen when the f:metadata is not a direct child of f:view. There are basically 3 options:
For Faces.next we can set it in stone. The first technical question is: why would it ever harm if f:metadata is not a direct child of f:view? One of the answers is that the f:metadata should reside in the view associated with viewId and not in a template (include/decorate) or composite as that would be prone to end up in confusing/unintentional behavior when used in multiple views/locations. One of the ways to guarantee consistent and predictable behavior that is that it must be a direct child of f:view. |
@BalusC Should this one be closed in favor of jakartaee/faces#1683 |
Not the same issue. But on second thought current Mojarra ticket should be closed and a new Faces ticket must be opened where we set in stone what exactly Faces should do during compile when f:metadata is found to not be a direct child of f:view. So hereby: jakartaee/faces#1849 |
Describe the bug
I've found implementation differences between Mojarra and MyFaces, and I'd like to know what behavior is correct?
The specification documents say that f:metadata "must be a child of the <f:view>". When it's not a child of f:view, should an exception be thrown?
Mojarra doesn't throw any exceptions, but MyFaces does.
Tested on Mojarra 3.0.0 and MyFaces 3.0.1.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Should Mojarra throw a similar exception or should MyFaces ignore this exception? Or should the spec doc be updated?
Screenshots

MyFaces Exception:
Both wars attached.
Wars.zip
Thanks!
The text was updated successfully, but these errors were encountered: