Example #1
0
 @RequestMapping(value = "/search", method = RequestMethod.GET)
 public String getSearch(Model model) {
   List<Blog> list = new ArrayList<Blog>();
   list = blogService.findAll();
   model.addAttribute("blog", new Blog());
   model.addAttribute("blogs", list);
   return PAGE_BLOGS;
 }
Example #2
0
  @RequestMapping(value = "/add", method = RequestMethod.POST)
  public String postAdd(@ModelAttribute("user") Blog blog) {

    blogService.save(blog);
    return "redirect:/blog/search";
  }