Methods Summary |
---|
private static java.util.Map | getCurrentInstance()
Map result = (Map) instance.get();
if (null == result) {
result = new HashMap();
setCurrentInstance(result);
}
return result;
|
public static java.lang.String | getExceptionMessageString(javax.el.ELContext context, java.lang.String messageId)
return getExceptionMessageString(context, messageId, null);
|
public static java.lang.String | getExceptionMessageString(javax.el.ELContext context, java.lang.String messageId, java.lang.Object[] params)
String result = "";
Locale locale = null;
if (null == context || null == messageId) {
return result;
}
if (null == (locale = context.getLocale())) {
locale = Locale.getDefault();
}
if (null != locale) {
Map threadMap = getCurrentInstance();
ResourceBundle rb = null;
if (null == (rb = (ResourceBundle)
threadMap.get(locale.toString()))) {
rb = ResourceBundle.getBundle("javax.el.PrivateMessages",
locale);
threadMap.put(locale.toString(), rb);
}
if (null != rb) {
try {
result = rb.getString(messageId);
if (null != params) {
result = MessageFormat.format(result, params);
}
} catch (IllegalArgumentException iae) {
result = "Can't get localized message: parameters to message appear to be incorrect. Message to format: " + messageId;
} catch (MissingResourceException mre) {
result = "Missing Resource in EL implementation: ???" + messageId + "???";
} catch (Exception e) {
result = "Exception resolving message in EL implementation: ???" + messageId + "???";
}
}
}
return result;
|
private static void | setCurrentInstance(java.util.Map context)Replace the Map with the argument context.
instance.set(context);
|