As a work-around, you could implement ServletResponseAware and call
setHeader() on the injected HttpServletResponse to set the proper locale
value.  But I agree that Struts should take the value for the header from
it's defined location.
  (*Chris*)

On Wed, Oct 10, 2012 at 9:20 AM, JOSE L MARTINEZ-AVIAL <jlm...@gmail.com>wrote:

> Hi all,
>  I'm using Struts 2.2.3. I've setup a property "struts.locale" with value
> "es_ES", for Spanish. But my application is multilanguage, so I setup the
> locale in the request using an interceptor:
>
> public String intercept(ActionInvocation invocation) throws Exception {
> [...]
> <get locale for the user>
> [...]
> invocation.getInvocationContext().setLocale(userLocale);
> return invocation.invoke();
> }
>
>
> The action and the JSPs(I'm using Tiles),correctly use the locale I set(so
> the response has the body in the correct language), but the header
> content-language is returning always "es_ES", no matter the locale I put in
> the invocationcontext.
>
> Any ideas on how can I get the correct locale in the header? a Meta tag in
> the page is not an option, since I have the same problem even with
> JSONResults.
>
> Thanks
>
> JL
>

Reply via email to