postmapping注解坑 ajax post带参数请求,后台怎么接收参数?
ajax post带参数请求,后台怎么接收参数?@RequestMapping(值=“/add”,方法=请求方法.POST)publicModelAndViewinsert(HttpServletRe
ajax post带参数请求,后台怎么接收参数?
@RequestMapping(值=“/add”,方法=请求方法.POST)publicModelAndViewinsert(HttpServletRequestrequest){Stringname=请求.getParameter(“name”)returnewmodelandview()}
~]:由spring定义。它用于指示这是一个控制器类。如果requstmapping注释中有类型参数,则默认值为get。您还可以指定post、put等。