i am new with emberjs my quation is need to serilize ember model to json send to http sever my code
var user = this.store.createRecord('user' ,{
userName:"suresh",
firstName:“suresh” } ); user.save();
and server side code is
@POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public User createUser(User user) { try { // JSONParser parser = new JSONParser(); // User object = (User) parser.parse(user); System.out.println(“in the post method” + user); // service.createUser(user);
return null;
} catch (Exception ex) {
Logger.getLogger(UserRestService.class.getName()).log(Level.SEVERE, null, ex);
}
return null;
}