/**
* @see I18nResourceProvider#getResource(String, String, Tag, PageContext)
*/
public String getResource(String resourceKey, String defaultValue, Tag tag, PageContext pageContext)
{
MessageSource messageSource = RequestContextUtils.getWebApplicationContext(pageContext.getRequest());
if (messageSource == null)
{
log.warn("messageSource not found");
return null;
}
// if resourceKey isn't defined either, use defaultValue
String key = (resourceKey != null) ? resourceKey : defaultValue;
String message = null;
message = messageSource.getMessage(key, null, null, RequestContextUtils
.getLocale((HttpServletRequest) pageContext.getRequest()));
// if user explicitely added a titleKey we guess this is an error
if (message == null && resourceKey != null)
{