- All Implemented Interfaces:
FaceletHandler
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.
- Since:
- 4.3
- Author:
- Bauke Scholtz
-
Field Summary
Fields inherited from class jakarta.faces.view.facelets.TagHandler
nextHandler, tag, tagId -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(FaceletContext context, UIComponent parent) First obtain the resource bundle by its name as specified in thebasenameattribute with the locale which is obtained as specified inFaces.getLocale()and the class loader which is obtained as specified inUtils.getClassLoader(Object)with theloaderattribute as argument.Methods inherited from class jakarta.faces.view.facelets.TagHandler
getAttribute, getRequiredAttribute, toString
-
Constructor Details
-
LoadBundle
The tag constructor.- Parameters:
config- The tag config.
-
-
Method Details
-
apply
First obtain the resource bundle by its name as specified in thebasenameattribute with the locale which is obtained as specified inFaces.getLocale()and the class loader which is obtained as specified inUtils.getClassLoader(Object)with theloaderattribute as argument. Finally set the resource bundle in the request scope by the name as specified in thevarattribute.- Throws:
IOException
-