@RequestMapping( method = RequestMethod.POST, consumes = {"application/json"}) @ResponseStatus(HttpStatus.CREATED) public HttpEntity<?> create( @RequestBody Link l, @Value("#{request.requestURL}") StringBuffer parentUri) { Link link = linkManager.save(l); HttpHeaders headers = new HttpHeaders(); headers.setLocation(childLocation(parentUri, link.getId())); return new HttpEntity<Object>(headers); }
@RequestMapping(method = RequestMethod.GET) @ResponseBody public Collection<Link> list() { return linkManager.findAll(); }