/** * TODO - Should probably be stricter here in following the HTTP spec, i.e. returning the proper * 20x response instead of an automatic redirect */ @RequestMapping(value = "/{id}", method = RequestMethod.PUT, headers = ACCEPT_JSON) public String updateJson(@Valid @RequestBody USState state, @PathVariable("id") Long id) { Assert.isTrue(id.equals(state.getId())); state.merge(); return "redirect:/usstates/" + state.getId(); }