|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.struts.util.MessageResources net.sf.oness.common.webapp.controller.struts.CustomMessageResources
This class is a Custom Message Resource implementation for Struts. This class searches through a series of resource files passed to it via the constructor to obtain the localised value for a key passed. If the key cannot be resolved, it prints a warning message to the logger output.
<message-resources null="false" parameter="net.sf.oness.common.webapp.messages.Messages,net.sf.oness.common.webapp.messages.OtherMessages"/>
Field Summary | |
protected java.util.HashMap |
bundlesLoaded
hashmap holding the resource bundle for which we have already loaded the values |
protected java.util.HashMap |
resourceMap
hashmap for holding ther resource bundle key and value |
Fields inherited from class org.apache.struts.util.MessageResources |
config, defaultFactory, defaultLocale, factory, formats, log, returnNull |
Constructor Summary | |
CustomMessageResources(java.util.List configFiles)
Constructor accepting a list of resource bundle files. |
Method Summary | |
java.lang.String |
getMessage(java.util.Locale locale,
java.lang.String key)
|
protected void |
loadBundle(java.lang.String localeKey,
java.lang.String config)
Loads the resource bundle based on the locale. |
Methods inherited from class org.apache.struts.util.MessageResources |
escape, getConfig, getFactory, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessageResources, getReturnNull, isPresent, isPresent, localeKey, log, log, messageKey, messageKey, setReturnNull |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.HashMap bundlesLoaded
protected java.util.HashMap resourceMap
Constructor Detail |
public CustomMessageResources(java.util.List configFiles)
configFiles
- A List of resouce bundle files.Method Detail |
public java.lang.String getMessage(java.util.Locale locale, java.lang.String key)
MessageResources.getMessage(java.util.Locale,
java.lang.String)
protected void loadBundle(java.lang.String localeKey, java.lang.String config)
localeKey
- The localeconfig
- The resource file.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |