阅读背景:

在Spring MVC 3中不使用请求内容类型的Http Post。

来源:互联网 

code snippet:

代码片段:

@RequestMapping(method = RequestMethod.POST)//,  headers = "content-type=application/x-www-form-urlencoded")
public ModelAndView create(@RequestBody UserAccountBean account) {
    try{
        accounts.put(account.assignId(), account);
    }catch(RuntimeException ex)
    {
        return new ModelAndView("account/registerError");
    }
    return new ModelAndView("account/userVerification");
}
@RequestMapping(method



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: