Hi pete,
1.extended PropertyMessageResources.java
2.extended PropertyMessageResourcesFactory.java
3.call reload methode in SetLocaleAction.java
4.replaced <message-resources/> tag
1.
2.
3.
4.
It seems to work, but I am not sure.
The clearing of the resources hashmaps in the reload methode seems to solve the caching problem.
Is this okay!?
regards, rula
Quote
With those three changes to the action classes isn't the problem fixed ? All messages are now taken from the message catalog. They were taken from the message catalog even before the fix but were cached and so not changed if you decided to change the language of your UI.
1.extended PropertyMessageResources.java
2.extended PropertyMessageResourcesFactory.java
3.call reload methode in SetLocaleAction.java
4.replaced <message-resources/> tag
1.
Code Select
public class ReloadablePropertyMessageResources
extends PropertyMessageResources{
public ReloadablePropertyMessageResources(ReloadablePropertyMessageResourcesFactory factory, String config){
super(factory, config);
}
public ReloadablePropertyMessageResources(ReloadablePropertyMessageResourcesFactory factory, String config, boolean returnNull){
super(factory, config, returnNull);
}
public synchronized void reload(){
locales.clear();
messages.clear();
formats.clear();
}
}
2.
Code Select
public class ReloadablePropertyMessageResourcesFactory
extends PropertyMessageResourcesFactory{
public MessageResources createResources(String config){
return new ReloadablePropertyMessageResources(this, config, this.getReturnNull());
}
}
3.
Code Select
((ReloadablePropertyMessageResources)getResources(request)).reload();
4.
Code Select
<!--
<message-resources parameter="Messages" null="false"/>
-->
<message-resources parameter="Messages" com.konakart.ReloadablePropertyMessageResourcesFactory"/>
It seems to work, but I am not sure.
The clearing of the resources hashmaps in the reload methode seems to solve the caching problem.
Is this okay!?
regards, rula