title: Practical validation of JAXB data with JAX-RS?
body: <p>We are using JAX-RS with some fairly basic POJO entities and have a number of <code>@GET</code> and <code>@POST</code> annotated methods that <code>@Produce</code> and <code>@Consume</code> <code>MediaType.APPLICATION_JSON</code>, <code>MediaType.APPLICATION_XML</code>. Nothing spectacular.</p>
  
  <p>Question I have is how best should I validate the data coming in?</p>
  
  <p>We do not have an XML Schema although I could generate one. I would need to hook this in somehow which doesn't look terribly appealing and I have not found a concise example yet.</p>
  
  <p>We could use "bean validation" but I am again unsure how I might hook this up and invoke it.</p>
  
  <p>Finally (I think) we could for example add some <code>isValidForXXX()</code> methods to the entity POJOs and call them whenever we have an instance handed in to us.</p>
  
  <p>Recommendations anyone?</p>