> It must be a bean create by the framework, e.g. an action, then the
> LocalizedTextProvider gets injected. If you want to use it in some
> other context you can use this approach:
>
> LocalizedTextProvider provider =
> ActionContext.getContext().getInstance(LocalizedTextProvider.class)
> LocaleProviderFactory factory =
> ActionContext.getContext().getInstance(LocaleProviderFactory.class)
>
> provider.findText("a.key", factory.createLocaleProvider().getLocale());
>
>> StringEscapeUtils.unescapeHtml4(value.replaceAll("''", "'"));
> Why do you do this?
>
>
> Regards
Thanks! This works fine. And you are perfectly right:

StringEscapeUtils.unescapeHtml4(value.replaceAll("''", "'"));

Is not needed anymore. It seemed, if I am not mistaken, to be necessary
with:

LocalizedTextUtil.findDefaultText(key, getLocale());

Single quotes in my properties files are escaped with two single quotes.

Well it is and was kind of a hacky approach, to compensate for the lost
convenience method of getText(key) since 2.5.2. I do not like to do
things that way, and prefer to leave such details to the framework.

Markus

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@struts.apache.org
For additional commands, e-mail: dev-h...@struts.apache.org

Reply via email to