Ah... there's another method you might want to see:

http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/javax/faces/application/Application.html#evaluateExpressionGet(javax.faces.context.FacesContext,%20java.lang.String,%20java.lang.Class)

-- Adam


On 8/24/07, Simon Lessard <[EMAIL PROTECTED]> wrote:
> Ah, I see! So it's safe to assume that, in a JSF 1.2 environment, all
> implementations will work and not throw an UnsupportedOperationException
> then. I thought it meant that this was an optional operation that wasn't
> certain to succeed.
>
> As for the other part, it's just that I dislike to create ValueExpression in
> Java just to evaluate it right away. I guess I would have been forced to do
> that if the above method was not guaranteed to work.
>
>
> Regards,
>
> ~ Simon
>
>
> On 8/23/07, Adam Winer <[EMAIL PROTECTED]> wrote:
> > 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