struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JOSE L MARTINEZ-AVIAL <jlm...@gmail.com>
Subject content-language header with Struts2 does not uses the invocation locale
Date Wed, 10 Oct 2012 16:20:08 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message