-
Available since OmniFaces 4.3
The <o:loadBundle>
taghandler basically extends the standard <f:loadBundle>
with a new loader
attribute allowing you to explicitly set the desired ClassLoader
where the resource bundle should be looked up. Also the Locale
of the bundle is obtained with better default values than the default Faces implementation.
You can use the loader
attribute to specify an object whose class loader will be used to load the resource bundle specified in the basename
attribute. The class loader of the given object is resolved as specified in Utils.getClassLoader(Object)
. In the end this should allow you to use a more specific resource bundle when there are duplicate instances in the runtime classpath, e.g. via multiple (plugin) libraries.
The locale of the resource bundle is obtained as specified in Faces.getLocale()
.
Usage
You can use it the same way as <f:loadBundle>
, you only need to change f:
into o:
to get the extra support for loader
attribute and the improved locale resolving.