data is selecte all users in database
it will print out:
[com.test.abc.user.domain.User@b22379c, com.test.abc.user.domain.User@364b96e5, com.test.abc.user.domain.User@1c9fb03c, com.test.abc.user.domain.User@37eb41d2]
I want to know how can I get the value in it .
I want to make it to json string like str so that the front end can get it
Please help me !!
@ResponseBody
public String getList() {
List<User> data = memberObj.getCurrentMembers() ;
System.out.println(data);
//data to string
String str = "{\"data\": [{\"id\": \"1\",\"account\": \"[email protected]\",\"name\": \"sky\",\"nick\": \"abc\"}]}";
return str;
}