Esempio n. 1
0
 @RequestMapping(value = "/page", method = RequestMethod.POST)
 @ResponseStatus(HttpStatus.CREATED)
 @ResponseBody
 public WebPage addWebPage(@Valid @RequestBody WebPage webpage) {
   dao.addWebPage(webpage);
   return webpage;
 }
Esempio n. 2
0
 @RequestMapping(value = "/page/{id}", method = RequestMethod.DELETE)
 @ResponseBody
 public void deleteWebPage(@PathVariable("id") int id) {
   dao.deleteWebPage(dao.getWebPageById(id));
 }
Esempio n. 3
0
 @RequestMapping(value = "/page/{id}", method = RequestMethod.PUT)
 @ResponseStatus(HttpStatus.NO_CONTENT)
 public void saveWebPage(@PathVariable("id") int id, @Valid @RequestBody WebPage webpage) {
   webpage.setPageID(id);
   dao.updateWebPage(webpage);
 }
Esempio n. 4
0
 @RequestMapping(value = "/pages", method = RequestMethod.GET)
 @ResponseBody
 public List<WebPage> getAllWebPages() {
   return dao.getAllWebPages();
 }