@RequestMapping(value = "/updateTag", method = RequestMethod.POST)
 public String updateTag(ModelMap model, Tag tag) throws ServiceException {
   if (tag.getTagName().length() == 0) {
     tagService.deleteTag(tag.getTagId());
   } else {
     tagService.editTag(tag.getTagId(), tag.getTagName());
   }
   fillingTags(model, 0);
   return "addUpdateTags";
 }
 /**
  * Add new tag in news
  *
  * @param idNews
  * @param tagName
  * @return true when the operation was successful, otherwise false
  * @throws ServiceException
  */
 @Transactional(rollbackFor = ServiceException.class)
 @Override
 public boolean addTag(int idNews, String tagName) throws ServiceException {
   int id = tagService.addTag(tagName);
   boolean relationAddedIsSuccess = newsService.addRelationForTagAndNews(idNews, id);
   return id != 0 && relationAddedIsSuccess;
 }
 @RequestMapping(value = "/addTag", method = RequestMethod.POST)
 public String addTag(ModelMap model, Tag tag) throws ServiceException {
   if (tag.getTagName().length() != 0) {
     tagService.addTag(tag.getTagName());
   }
   fillingTags(model, 0);
   return "addUpdateTags";
 }
 private void fillingTags(ModelMap model, int tagId) throws ServiceException {
   List<Tag> tags;
   Tag tag1 = new Tag();
   tags = tagService.getAllTags();
   int idActiveTag = tagId;
   model.put("idActiveTag", idActiveTag);
   model.put("tags", tags);
   model.put("tag", tag1);
 }
 @RequestMapping(value = "/deleteTag", method = RequestMethod.POST)
 public String deleteTag(ModelMap model, Tag tag) throws ServiceException {
   tagService.deleteTag(tag.getTagId());
   fillingTags(model, 0);
   return "addUpdateTags";
 }