Use changed TextProviderFactory (for upcoming XW 2.0.2) to fix issue with broken i18n tag / missing thread safety for TPF

See also:
http://jira.opensymphony.com/browse/XW-487
http://jira.opensymphony.com/browse/XW-476

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@523622 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
René Gielen
2007-03-29 08:34:01 +00:00
parent d04d3fa173
commit 08b564d52d
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -252,7 +252,7 @@
<dependency>
<groupId>opensymphony</groupId>
<artifactId>xwork</artifactId>
<version>2.0.1</version>
<version>2.0.2-SNAPSHOT</version>
</dependency>
<!--<dependency>-->
@@ -27,6 +27,7 @@ import java.util.ResourceBundle;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.StrutsException;
import org.apache.struts2.dispatcher.Dispatcher;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.LocaleProvider;
@@ -102,7 +103,9 @@ public class I18n extends Component {
if (bundle != null) {
final Locale locale = (Locale) getStack().getContext().get(ActionContext.LOCALE);
getStack().push(TextProviderFactory.getInstance(bundle, new LocaleProvider() {
TextProviderFactory tpf = new TextProviderFactory();
Dispatcher.getInstance().getContainer().inject(tpf);
getStack().push(tpf.createInstance(bundle, new LocaleProvider() {
public Locale getLocale() {
return locale;
}
@@ -401,9 +401,6 @@ Caused by: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyExcepti
ObjectTypeDeterminer objectTypeDeterminer = container.getInstance(ObjectTypeDeterminer.class);
ObjectTypeDeterminerFactory.setInstance(objectTypeDeterminer);
TextProvider textProvider = container.getInstance(TextProvider.class);
TextProviderFactory.setInstance(textProvider);
return container;
}