*/
public String getString(final String key, final Component component, final IModel<?> model,
final Locale locale, final String style, final String defaultValue)
throws MissingResourceException
{
final IResourceSettings resourceSettings = Application.get().getResourceSettings();
String value = getStringIgnoreSettings(key, component, model, locale, style, null);
if ((value == null) && (defaultValue != null))
{
// Resource not found, so handle missing resources based on
// application configuration and try the default value
if (resourceSettings.getUseDefaultOnMissingResource())
{
value = defaultValue;
// If a property value has been found, or a default value was given,
// than replace the placeholder and we are done
if (value != null)
{
return substitutePropertyExpressions(component, value, model);
}
}
}
// If a property value has been found, or a default value was given,
// than replace the placeholder and we are done
if (value != null)
{
return value;
}
if (resourceSettings.getThrowExceptionOnMissingResource())
{
AppendingStringBuffer message = new AppendingStringBuffer("Unable to find property: '");
message.append(key);
message.append("'");