How to build custom json for return with jersey java? -
hi building response using json.org, want return values usin response dont know how build response :/
for example, using json im return string in methods:
public string create(product entity) { jsonobject response = null; try { new productbll().create(entity); response = new jsonobject(); response.put("status", "ok"); response.put("message","product created!"); } catch (exception ex) { response = new jsonobject(); response.put("status", "error"); response.put("message",ex.getmessage()); } return response.tostring(); }
its works want using "response" return custom message similar jsonobject building
Comments
Post a Comment