I try to migrate from Struts 2.5.10
to 2.5.17
but LocalizedTextUtil class is removed.
See my code below:
URL[] urls;
try {
String resourceFolder = PropertiesManager.get(Constants.PROP_RESOURCES_FOLDER);
File file = new File(resourceFolder);
URL url = file.toURI().toURL();
urls = new URL[]{url};
ClassLoader cl = new URLClassLoader(urls);
LocalizedTextUtil.setDelegatedClassLoader(cl);
LocalizedTextUtil.addDefaultResourceBundle("global");
}
catch (MalformedURLException e) {
e.printStackTrace();
}
and in struts.xml
<constant name="struts.custom.i18n.resources" value="global" />
Although i used instead the GlobalLocalizedTextProvider and StrutsLocalizedTextProvider, the resource is not added. Also i tried to inject LocalizedTextProvider with the same result. Should I use another technique?