Get language code from the executing thread

2012-03-27 Thread Mutaz Qasem
Hi I have a resource public class SomeResource extends ServerResource{ @Post(json) public Representation create(JsonRepresentation entity){ JSONObject jsonObj = entity.getJsonObject(); Literal literal = new Vlidator().validate(jsonObj.getString(textKey)); } } public

Re: Get language code from the executing thread

2012-03-27 Thread Tim Peierls
I'm assuming that by language code you mean the value of the Accepted-Languages header from the request. You can use Request.getCurrent() to get the, um, current request, from which you can retrieve the language(s). This works as long as you're in the same thread that is handling the request, or