Package org.imixs.workflow.faces.util
Class ResourceBundleHandler
java.lang.Object
org.imixs.workflow.faces.util.ResourceBundleHandler
The ResourceBundleHandler provides helper method to lookup a label in
different bundles. This simplifies the front end implementation as the client
does not have to know the bundle a specific resource is located:
<h1>#{resourceBundleHandler.findMessage('application_title')}</h1>
The ResourceBundleHandler load the bundles based on the current user locale.
Resource bundle instances created by the getBundle factory methods are cached by default, and the factory methods return the same resource bundle instance multiple times if it has been cached. For that reason a RequestScoped bean is used here.
The class searches for the resource bundles named 'bundle.messages', 'bundle.app' and 'bundle.custom'. You can overwrite the bundle names with the imixs property value 'resourcebundle.names'. The later entries have a higher priority in case a key is stored in multiple bundles.
- Version:
- 1.0
- Author:
- rsoika
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfindMessage
(String key) This helper method findes a message by key searching all bundles.Default getter methodvoid
init()
This method finds the browser locale
-
Constructor Details
-
ResourceBundleHandler
public ResourceBundleHandler()
-
-
Method Details
-
init
@PostConstruct public void init()This method finds the browser locale -
getBrowserLocale
-
getMessagesBundleByName
-
get
Default getter method- Parameters:
key
-- Returns:
-
findMessage
This helper method findes a message by key searching all bundles.- Parameters:
pe
-
-