What is the best and more portable way to get the client locale in the context of a Jersey (JAX-RS) request? I have the following code:
@GET
@Produces("text/html")
@Path("/myrequest")
public Response myRequest(@Context HttpServletRequest request) {
Locale locale = ...
}
Please assume that the "request" is made by some javascript code within a browser, by calling window.location = ...;
Locale locale = request.getLocale();