/** * Return the localized message for the specified key, * otherwise return <code>null</code>. * * @param key Message key */ public String getMessage(String key) { MessageResources resources = getMessageResources(); if (resources == null) return null; return resources.getMessage(RequestUtils.getUserLocale(request, null), key); }
/** * <p> Return the localized message for the specified key, otherwise * return <code>null</code>. </p> * * @param key Message key */ public String getMessage(String key) { MessageResources resources = getMessageResources(); if (resources == null) { return null; } return resources.getMessage(RequestUtils.getUserLocale(request, null), key); }
/** * Return true if a message string for the specified message key * is present for the user's Locale. * * @param key Message key */ public boolean isMessage(String key) { // Look up the requested MessageResources MessageResources resources = getMessageResources(); if (resources == null) { return false; } // Return the requested message presence indicator return resources.isPresent(RequestUtils.getUserLocale(request, null), key); }
/** * <p> Return true if a message string for the specified message key is * present for the user's Locale. </p> * * @param key Message key */ public boolean isMessage(String key) { // Look up the requested MessageResources MessageResources resources = getMessageResources(); if (resources == null) { return false; } // Return the requested message presence indicator return resources.isPresent(RequestUtils.getUserLocale(request, null), key); }
/** * <p> Look up and return a message string, based on the specified * parameters. </p> * * @param key Message key to be looked up and returned * @param args Replacement parameters for this message */ public String getMessage(String key, Object[] args) { MessageResources resources = getMessageResources(); if (resources == null) { return null; } // Return the requested message if (args == null) { return resources.getMessage(RequestUtils.getUserLocale(request, null), key); } else { return resources.getMessage(RequestUtils.getUserLocale(request, null), key, args); } }
/** * Look up and return a message string, based on the specified parameters. * * @param key Message key to be looked up and returned * @param args Replacement parameters for this message */ public String getMessage(String key, Object args[]) { MessageResources resources = getMessageResources(); if (resources == null) return null; // Return the requested message if (args == null) return resources.getMessage( RequestUtils.getUserLocale(request, null), key); else return resources.getMessage( RequestUtils.getUserLocale(request, null), key, args); }