I am making a POST call from angular JS to spring REST API . I would like to know how can i design my spring controller so that it returns a bunch of error messages(may be List ?) on failure case. If it succeeds i would like to return an message customer has been created
failure case eg :(Msg to be displayed on Front End) Customer Already Exists Customer Name Cannot be Empty
Success case eg : (displayed on front end) Customer has been Created
How can i decide and display them from angular JS controller after the REST call
A sample snippet or a suggestion on how to proceed would be very much helpful