这是我的控制器的代码。
@RequestMapping(value="/save", method=RequestMethod.POST )
public ModelAndView saveArticle(@ModelAttribute Article article, BindingResult result) {
System.out.println("inside controller"+article.getArticleName()+" "+article.getArticleDesc());
int a=articleService.addArticle(article);
if(a==1)
{
return new ModelAndView("success");
}
else
{
return new ModelAndView( "error");
}
/*else if(a==0){
return new ModelAndView("error");
}*/
//return new ModelAndView("redirect:/articles.html");
}
如何获取json格式发送的articleName和desc,然后转换成java对象?