Tuesday, 15 July 2014

web services - Input validation in java -



web services - Input validation in java -

i trying add together input validation annotations list of items post endpoint of webservice takes.

import javax.validation.valid; @requestmapping(value = "/addcustomer", method=requestmethod.post, consumes="application/json") public void addcustomer(@requestbody list<customer> customer) { (customer client : customer) { //do stuff } } import javax.validation.constraints.notnull; class client { @notnull private string name; public cusomter(name){ this.name = name; } public void setname(string name) { this.name= name; } public string getname() { homecoming name; } }

i want validate each client in list, create sure none of them have empty name. able validate input using @valid tag if input 1 client object, how do same list of customers?

java web-services validation

No comments:

Post a Comment