Avatar of heppa
Flag for Luxembourg

asked on 

Struts: Overwriting locale in the request

We are using Struts 1.1 (i know, it's old, but it's a constraint) to build a web application. We also have application.properties for 3 languages. Due to political decisions I am supposed to "remove" multilanguage support quickly, meaning that the application won't react on the given locale. My problem is, that it always reacts on the locale given in the request on first access.

I tried to set a fix locale to the session, both with setLocale(java.util.Locale) method as well as setting it to the session directly in the Action Delegation class (we have a GenericAction with an abstract method executeTask that extends Action and all other Actions are extending GenericAction). Both didn't have an effect on first request.

It is really the only option NOT to include the application_de.properties in the war in order to fall back to english all the time, even if the browser locale is set to, say, de_DE?

I appreciate any help very much, as I just started to try to understand Struts. It normally works out quite well, but this does not make sense to me. I thought, the setLocale method would have this exact purpose. Thanks a lot in advance.

Web ApplicationsJSP

Avatar of undefined
Last Comment

8/22/2022 - Mon