예제 #1
0
 @RequestMapping(value = "/categories", method = RequestMethod.POST, produces = "application/json")
 @ResponseBody
 public Category saveItem(@RequestBody Category category) {
   return dao.saveCategory(category);
 }
예제 #2
0
 @RequestMapping(value = "/categories", method = RequestMethod.GET, produces = "application/json")
 @ResponseBody
 public List<Category> getItems() {
   return dao.getCategories();
 }