Reputation: 1583
I have used JSONObject json = (JSONObject)new JSONParser().parse(jb.toString());
for getting json object in servlet and JSONObject result=new JSONObject();response.getWriter().write(result.toString());
for posting json object. But i have no idea how to do this in struts 2.0.
Upvotes: 0
Views: 143
Reputation: 72
String "str" have Json message who extract json in action using key value pair example to more understanding...
JSONObject json = new JSONObject(str);
rec_id = json.getInt("receptionist_id");
tag_id = json.getInt("tag_id");
Upvotes: 1
Reputation: 7623
You need the Json Plug in. This plug in will be able to parse your action response into a JSON automatically and the interceptors will store your request into your action.
You have an example with Struts2 with annotations and datatables here
Upvotes: 2