The idea is to avoid AbstractMethodErrors on pre-existing
apps that happen to have a 1.1 Application implementation.
You'd still get an UnsupportedErrorException.  The
Application implementation provided by a 1.2 implementation
has to return a ResourceBundle (or throw an exception).

I'm not sure what you mean by "the correct way to
access the bundle" - this is the programmatic way,
in EL you'd use #{name}.

-- Adam


On 8/23/07, Simon Lessard <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> Reading the JAF 1.2 API I found the following:
>  getResourceBundle public java.util.ResourceBundle
> getResourceBundle(FacesContext ctx,
>
>  java.lang.String name)
>
>
> Find a ResourceBundle as defined in the application configuration resources
> under the specified name. If a ResourceBundle was defined for the name,
> return an instance that uses the locale of the current UIViewRoot.
>
> The default implementation throws UnsupportedOperationException and is
> provided for the sole purpose of not breaking existing applications that
> extend this class.
>
>  Returns:ResourceBundle for the current UIViewRoot, otherwise null Throws:
> FacesException - if a bundle was defined, but not resolvable
> java.lang.NullPointerException - if ctx == null || name == nullSince:1.2 and
> in MR 1:
>  getResourceBundle public java.util.ResourceBundle
> getResourceBundle(FacesContext
>  ctx,
>  java.lang.String name)
>
>
> Find a ResourceBundle as defined in the application configuration resources
> under the specified name. If a ResourceBundle was defined for the name,
> return an instance that uses the locale of the current UIViewRoot .
>
> The default implementation throws UnsupportedOperationException and is
> provided for the sole purpose of not breaking existing applications that
> extend this class.
>
>  Returns:ResourceBundle for the current UIViewRoot, otherwise null Throws:
> FacesException - if a bundle was defined, but not resolvable
> java.lang.NullPointerException - if ctx == null || name == nullSince:1.2
> Both are exactly the same. However, I wonder why the doc says the default
> implementation provides that method only to not break existing applications
> when JSF 1.1 did not even have that method... I really cannot figure that
> one out. Can anyone enlighten me? Also, what is the correct way to access
> the bundle if not that one? I hope it's not involve using the
> ExpressionFactory with #{name} expression.
>
>
> Regards,
>
> ~ Simon
>
>

Reply via email to