@Test public void testDoAddBlog() throws Exception { }
@RequestMapping(value = "account", method = RequestMethod.POST) public String doAddBlog(@Valid @ModelAttribute("blog") RssFeedEntity rssFeedEntity, Model model, Principal principal, BindingResult result) { if (result.hasErrors()) { return account(model, principal); } String name = principal.getName(); blogService.save(rssFeedEntity, name); return "redirect:/account"; }
UserController { @RequestMapping(value = "account", method = RequestMethod.POST) public String doAddBlog(@Valid @ModelAttribute("blog") RssFeedEntity rssFeedEntity, Model model, Principal principal, BindingResult result) { if (result.hasErrors()) { return account(model, principal); } String name = principal.getName(); blogService.save(rssFeedEntity, name); return "redirect:/account"; } }
UserController { @RequestMapping(value = "account", method = RequestMethod.POST) public String doAddBlog(@Valid @ModelAttribute("blog") RssFeedEntity rssFeedEntity, Model model, Principal principal, BindingResult result) { if (result.hasErrors()) { return account(model, principal); } String name = principal.getName(); blogService.save(rssFeedEntity, name); return "redirect:/account"; } @Autowired  UserController(IUserService userService, IRssFeedService blogService); }
UserController { @RequestMapping(value = "account", method = RequestMethod.POST) public String doAddBlog(@Valid @ModelAttribute("blog") RssFeedEntity rssFeedEntity, Model model, Principal principal, BindingResult result) { if (result.hasErrors()) { return account(model, principal); } String name = principal.getName(); blogService.save(rssFeedEntity, name); return "redirect:/account"; } @Autowired  UserController(IUserService userService, IRssFeedService blogService); @RequestMapping("account") String account(Model model, Principal principal); @RequestMapping(value = "account", method = RequestMethod.POST) String doAddBlog(@Valid @ModelAttribute("blog") RssFeedEntity rssFeedEntity, Model model,
                            Principal principal, BindingResult result); @RequestMapping(value = "blog/remove/{id}") String removeBlog(@PathVariable Long id); }
UserController { @RequestMapping(value = "account", method = RequestMethod.POST) public String doAddBlog(@Valid @ModelAttribute("blog") RssFeedEntity rssFeedEntity, Model model, Principal principal, BindingResult result) { if (result.hasErrors()) { return account(model, principal); } String name = principal.getName(); blogService.save(rssFeedEntity, name); return "redirect:/account"; } @Autowired  UserController(IUserService userService, IRssFeedService blogService); @RequestMapping("account") String account(Model model, Principal principal); @RequestMapping(value = "account", method = RequestMethod.POST) String doAddBlog(@Valid @ModelAttribute("blog") RssFeedEntity rssFeedEntity, Model model,
                            Principal principal, BindingResult result); @RequestMapping(value = "blog/remove/{id}") String removeBlog(@PathVariable Long id);  }