Convenient programmatic access to localized messages
----------------------------------------------------
Key: SHALE-269
URL: http://issues.apache.org/struts/browse/SHALE-269
Project: Shale
Issue Type: New Feature
Components: Core
Affects Versions: 1.0.3
Reporter: Craig McClanahan
Priority: Minor
>From the Shale User Mailing List (Adrian Mitev <[EMAIL PROTECTED]>):
==========
Hi! It is a good idea to add method like addMessageFromBundle that
does something like this:
public void addMessageFromBundle(UIComponent component,String
bundleMessageKey) {
ResourceBundle bundle = null;
try {
bundle = ResourceBundle.getBundle(getFacesContext()
.getApplication().getMessageBundle());
String message = bundle.getString(bundleMessageKey);
error(componeng,message);
} catch (MissingResourceException e) {
e.printStackTrace();
}
}
==========
We might also look at ways to provide for parameter replacement in such
messages.
Seam also has a cute utility that lets you build messages out of EL expressions
for parameter replacement.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira