myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Lessard" <simon.lessar...@gmail.com>
Subject JSF 1.2 API question
Date Thu, 23 Aug 2007 14:35:05 GMT
Hello all,

Reading the JAF 1.2 API I found the following:
getResourceBundle

public java.util.ResourceBundle *getResourceBundle*(FacesContext
<http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/javax/faces/context/FacesContext.html>
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<http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/javax/faces/component/UIViewRoot.html>
.

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<http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/javax/faces/FacesException.html>-
if a bundle was defined, but not resolvable
java.lang.NullPointerException - if ctx == null || name == null*Since:*1.2 and
in MR 1:
getResourceBundle

public java.util.ResourceBundle *getResourceBundle*(FacesContext
<http://java.sun.com/javaee/javaserverfaces/1.2_MR1/docs/api/javax/faces/context/FacesContext.html>
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<http://java.sun.com/javaee/javaserverfaces/1.2_MR1/docs/api/javax/faces/component/UIViewRoot.html>
.

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<http://java.sun.com/javaee/javaserverfaces/1.2_MR1/docs/api/javax/faces/FacesException.html>-
if a bundle was defined, but not resolvable
java.lang.NullPointerException - if ctx == null || name == null*Since:*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

Mime
View raw message