postmapping注解坑 ajax post帶參數(shù)請求,后臺怎么接收參數(shù)?
ajax post帶參數(shù)請求,后臺怎么接收參數(shù)?@RequestMapping(值=“/add”,方法=請求方法.POST)publicModelAndViewinsert(HttpServletRe
ajax post帶參數(shù)請求,后臺怎么接收參數(shù)?
@RequestMapping(值=“/add”,方法=請求方法.POST)publicModelAndViewinsert(HttpServletRequestrequest){Stringname=請求.getParameter(“name”)returnewmodelandview()}
~]:由spring定義。它用于指示這是一個控制器類。如果requstmapping注釋中有類型參數(shù),則默認(rèn)值為get。您還可以指定post、put等。