Setting: Basic-Struts2-AppFuse 2.0.2-with core classes

In my scenario, my User has a default language which might differ from the
browser's locale. Hence, I'd like to change the locale programmatically
relative to the user's default language. There are two ways to do this:

1. Store the locale preference in the session map under the key
WW_TRANS_I18N_LOCALE
2. Provide an own implementation of LocaleProvider on an action, i.e.,
implement 'getLocale()'

AppFuse follows the second approach, as all actions derive from BaseAction
which in turn inherits methods from ActionSupport. The latter also
implements LocaleProvider which simply sets the locale to the browsers
preference. It takes the information from the ActionContext.

I want to override the default behaviour, but got stuck. 
1) The best place to set WW_TRANS_I18N_LOCALE is right after a successful
Login. Unfortunately, AppFuse ships no LoginAction class and seems to pass
LoginControl to SpringSecurity. 
2) The best place to override 'getLocale' is BaseAction. So I copied
BaseAction.java from a full-source project into my basic Struts2 project and
made the mentioned adaptation. However, 'getModel()' seems never to be
accessed. I suspect that there is a classpath problem, because the origin
BaseAction class is still shipped in the war.

Questions:
1. How can I exclude BaseAction class from war dependencies. (a similar
process as in putting core classes to the project)?
2. Anything about a LoginAction class I have not noticed so far?
3. Any other alternative?

-- 
View this message in context: 
http://www.nabble.com/How-to-change-the-locale-programmatically-tp18706402s2369p18706402.html
Sent from the AppFuse - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to