}
@RequestMapping(value = "modify/{articleId}", method = RequestMethod.POST)
public ModelAndView modifyArticleExecute(@PathVariable Long articleId, String title, String content, String digest, Long categoryId,
String categoryName, Integer authority, String submitToken) {
User user = (User) WebHelper.getSessionAttribute(null, Constant.SESSION_USER);
ModelAndView mav = new ModelAndView();
if (user != null) {
Article article = new Article(authority, user.getId(), user.getPortrait(), user.getNickname(), title, content, digest,
categoryId, categoryName);
article.setSubmitToken(submitToken);
// //
String errMsg = validateForm("modifyArticleForm", article);
if (errMsg != null) {
ModelAndView returnMav = modifyArticleRequest(articleId);
return processValidationErrors("errMsg", errMsg, returnMav);
}
// //
articleService.modifyArticle(articleId, authority, user.getId(), title, content, digest, categoryId, categoryName);
mav.setViewName("redirect:../view/" + articleId + URL_SUFFIX);
} else {
mav.addObject("REQUEST_FROM", "article/modify/" + articleId + URL_SUFFIX);
mav.setViewName(ViewPaths.USER_LOGIN);
}