2014-06-11 19:16 GMT+04:00 Patrick Kolodziejczyk <patrick.kolodziejc...@viseo.com>: > Hi, > > I am looking to add internationalization on my webservice that work on tomcat. > In one old documentation of Tomcat, it's speak about the Header parameter > "Accept-Language" that is read by StaticInterceptor and set the Locale. > Source : http://tomcat.apache.org/tomcat-3.3-doc/serverxml.html > > It's just what I need to use the right ResourceBundle with out adding > explicitly a parameter in all my services. > But I don't find others documentation about it... On newer version (I use > tomcat 6) or on how configure it. > > > I did some test for see if the parameter is send (and it's) > @POST > @Path("/create/") > public WSBooleanResponse create(EnvoyerEmailActivationCompteProxy tiers, > @HeaderParam("Accept-Language") String language) { > ServiceResponse response = createDefaultServiceResponse(); > > System.out.println(language); > > if(language != null){ > LocaleEditor le =new LocaleEditor(); > le.setAsText(language); > Locale.setDefault((Locale) le.getValue()); > } > > But I don't have StaticInterceptor declared in my server.xml and I don't know > where I need to put it in the structure. > > If someone have any experience on it, or any documentation. It's will help me > a lot. >
In Servlet API the locales specified in "Accept-Language" header are available via javax.servlet.ServletRequest.getLocales() method. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org