ZPY博客

SpringBoot以form形式接受单值

controller里:

@PostMapping("{prodNo}/edit")
    @RequestMapping(value = "/{prodNo}/edit", method = { RequestMethod.GET, RequestMethod.POST })
    public ModelAndView edit(FormEntity formEntity, BindingResult result){
}

FormEntity包含prodNo字段即可用formEntity.prodNo取得。