jsr372-experts@javaserverfaces-spec-public.java.net

[jsr372-experts] Difference in UIInput#processValidators() in Mojarra and MyFaces

From: Bauke Scholtz <balusc_at_gmail.com>
Date: Thu, 8 Jan 2015 22:45:01 +0100

Hi,

While observing different behavior of composite components with a
componentType extending UIInput, I noticed that the
UIInput#processValidators() API is implemented differently in Mojarra and
MyFaces.

In Mojarra, the processValidators() is first executed on the UIInput
component itself and then on its facets/children. But in MyFaces, the
processValidators() is first executed on the UIInput component's
facets/children and then on itself. Exactly the other way round.

I've always designed my composites based on what Mojarra does, which feels
more intuitive as it follows the component tree hierarchy (top-down
approach), but they break in MyFaces. Who's correct here? Why exactly was
one or the other approach chosen?

Mojarra source code:
http://grepcode.com/file/repo1.maven.org/maven2/org.glassfish/javax.faces/2.2.0/javax/faces/component/UIInput.java#UIInput.processValidators%28javax.faces.context.FacesContext%29

MyFaces source code:
http://grepcode.com/file/repo1.maven.org/maven2/org.apache.myfaces.core/myfaces-api/2.2.0/javax/faces/component/UIInput.java#UIInput.processDecodes%28javax.faces.context.FacesContext%29

Cheers, Bauke