title: Play 2 - Can't return Json object in Response
body: <p>I'm trying to do some RESTFull Web service POC using Play 2.1.3  </p>
  
  <p>I have the following class: </p>
  
  <pre><code>case class Student(id: Long,firstName: String,lastName: String) 
  </code></pre>
  
  <p>Now I would like to create RESTfull URI which will get Json serialised Student POJO and return the same POJO in response.</p>
  
  <pre><code>implicit val studentReads = Json.reads[Student]
  implicit val studentWrites = Json.writes[Student]
  
  
  def updateStudent = Action(parse.json){
    request=&gt;request.body.validate[Student].map{
      case xs=&gt;Ok(xs)}.recoverTotal{
        e =&gt; BadRequest("Detected error:"+ JsError.toFlatJson(e))
      }
    } 
  </code></pre>
  
  <p>But I'm getting compilation Error - </p>
  
  <pre><code>Cannot write an instance of entities.Student to HTTP response. Try to define a 
       Writeable[entities.Student]
  </code></pre>
  
  <p>I just provided <code>Writes[A]</code> as an implicit variable. </p>
  
  <p>What else am I missing? </p>