コード例 #1
0
 @RequestMapping(
     value = "/books",
     method = RequestMethod.GET) // ,            produces = MediaType.APPLICATION_JSON_VALUE)
 @ResponseBody
 public Set<Book> getBooks(@RequestHeader(required = false) String accept) {
   System.out.println("headers:" + accept);
   // model.addAttribute("movie", name);
   return bookService.getBooks();
 }
コード例 #2
0
 @RequestMapping(value = "/book/{title}", method = RequestMethod.GET)
 @ResponseBody
 public Book getBook(@PathVariable String title) {
   return bookService.getBook(title);
 }