So, I may be missing the obvious, but if the method's precondition is that it 
receives an int[], shouldn't you be doing input validation anyway?

if (userData instanceof int[] && ((int[]) userData.length > 0) {
    return userData;
}
else {
    getResponse().setStatus(Status.BAD_REQUEST);
}


Or are you looking for an out-of-band solution for many such handlers? If the 
latter, you probably could implement your own derivation of Restlet Filter does 
the above check, and plumb your Filter derivative upstream from your Resource.

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

Reply via email to