struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alireza Fattahi (JIRA)" <>
Subject [jira] [Commented] (WW-4829) Set a global resource bundle in class
Date Mon, 31 Jul 2017 12:44:00 GMT


Alireza Fattahi commented on WW-4829:

Can you please help me with this too:

Here is the code:

public class CustomStrutsTextProviderFactory extends StrutsTextProviderFactory {
	protected TextProvider getTextProvider(Class clazz) {
		return new CustomTextProvider(clazz, localeProviderFactory.createLocaleProvider(), localizedTextProvider);


The code works, but for every request the *CustomStrutsTextProviderFactory.getTextProvider*
is called. So the *localizedTextProvider.addDefaultResourceBundle* is called for every request.
Although the   *AbstractLocalizedTextProvider.addDefaultResourceBundle* make sure bundle is
not doesn't get added more than once ... I think the *CustomStrutsTextProviderFactory* could
be write better.

> Set a global resource bundle in class 
> --------------------------------------
>                 Key: WW-4829
>                 URL:
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.5.12
>            Reporter: Alireza Fattahi
>             Fix For: 2.5.13
> In struts 2.5.12 the *LocalizedTextUtil* is removed.
> We used to `*LocalizedTextUtil.addDefaultResourceBundle*` in our classes to add resource
bundles. This was mentioned in
> Can you please let me know how this can be done with this change ?!

This message was sent by Atlassian JIRA

View raw message