boolean result = super.start(writer);
try {
String name = this.findString(this.name, "name", "Resource bundle name is required. Example: foo or foo_en");
ResourceBundle bundle = (ResourceBundle) findValue("texts('" + name + "')");
if (bundle == null) {
bundle = LocalizedTextUtil.findResourceBundle(name, (Locale) getStack().getContext().get(ActionContext.LOCALE));
}
if (bundle != null) {
final Locale locale = (Locale) getStack().getContext().get(ActionContext.LOCALE);
TextProviderFactory tpf = new TextProviderFactory();
Dispatcher.getInstance().getContainer().inject(tpf);
getStack().push(tpf.createInstance(bundle, new LocaleProvider() {
public Locale getLocale() {
return locale;
}
}));
pushed = true;
}
} catch (Exception e) {
String msg = "Could not find the bundle " + name;
throw new StrutsException(msg, e);
}
return result;