users@javaserverfaces.java.net

Re: JSF 1.2_07 and abstract beans

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Thu, 24 Jan 2008 09:15:21 -0800

Yann Simon wrote:
> Hi!
>
> I tried to update from JSF 1.2_04 to JSF 1.2_07 and I got an error.
> I use abstract beans sometimes and the JSF 1.2_07 validate that the
> beans are not abstract.
>
> The error message was hidden in the stack trace because JSF tried to
> give me a localized error message and cannot find a bundle in my locale.
> (com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED!
> Can't find bundle for base name ApplicationResources, locale de_DE)
> (Why does JSF need a bundle in my locale to get me a validation error? )
We've localized the error messages. By default, we include bundles for
en, es, de, and fr.
May just have to add code to force the locale.
>
> OK, back to my abtract beans.
>
> I use abstract bean, because it is very convenient.
> I can write my xhtml with #{TheAbstractBean.xyz}.
>
> To go to this page, I just use a sort of "bean injection" like this one:
> <h:commandLink action="#{TheBean.init}">
> <f:setPropertyActionListener value="#{TheBean}"
> target="#{TheAbstractBean}" />
> </h:commandLink>
>
> With TheBean extends TheAbstractBean.
>
> I can also re-use the same xhtml with different implementations of the
> abstract bean.
> That works great.
> But as the validation with JSF 1.2_07 failed, i cannot upgrade... :(
>
> Any reason to validate that? Part of specifications?
The managed bean section of the spec states the following for
managed-bean-class values:

<managed-bean-class> -- The fully qualified class name of the
application class
used to instantiate a new instance. This class must conform to JavaBeans
design patterns
-- in particular, it must have a public zero-args constructor, and must
have public property
setters for any properties referenced with nested <managed-property>
elements -- or
it must be a class that implements java.util.Map or java.util.List.




>
> Yann
>
>
>