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 class Vlidator{
     public Literal validate(String someText){
          String langCode = getLanguageCode();
          LiteralManager lm = new LiteralManager();
          return lm.createLiteral(someText, langCode);
     }
     public String getLanguageCode(){
        // How to get the lang code??!!
    }
}

How can I implement getLanguageCode() method to retrieve the language code
of the thread of the current request. Considering that Vlidator class is
defined somewhere else outside the SomeResource class.
Is that possible?

Thanks
Mutaz

--
View this message in context: 
http://restlet-discuss.1400322.n2.nabble.com/Get-language-code-from-the-executing-thread-tp7409075p7409075.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2941092

Reply via email to