Exemplo n.º 1
0
  @RequestMapping({"/addAuthorAction"})
  public ModelAndView addCommentPage(@ModelAttribute("newsVO") NewsManagementVO newsVO)
      throws ServiceExeption {

    ModelAndView mv = new ModelAndView("redirect:authorsPage");

    if (ValidityChecker.checkValidity(
        newsVO.getAuthor().getAuthorName(), EXPRESSION_FOR_TAGS_AUTHORS_TITLE)) {
      serviceManager.addAuthor(newsVO);
    } else {
      mv.addObject("notValid", ConfigurationManager.getProperty("message.fail.authorName"));
    }

    mv.addObject("authorsList", serviceManager.getAuthorsList());

    return mv;
  }