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