users@jersey.java.net

[Jersey] To throw or to return "error" code

From: John Smith <java.dev.mtl_at_gmail.com>
Date: Mon, 24 Oct 2011 13:09:46 -0400

So i have been following the tutorials with Netbeans simple crud stuff. I
get it...

Now the question is I'm doing an "add" operation and I want to validate the
data before...

Should I throw an exception or return an "error" code. I'm thinking I should
return an error code. Keeping in mind I will also add a function that will
query the system and return a list of actions (ADD, UPDATE, DOSOMETHING)
executed and what their final status was.

On a side note what's a good way to validate the incoming data. let JAXB
with XSL do it. or use some sort of 3rd party bean validation API like
hibernate validation?