HTTP Status 400 – Bad Request

前端 未结 2 1636
孤街浪徒
孤街浪徒 2020-12-22 01:21

Hi i am trying to select category while adding new category.Category details get from DB and I am trying to fetch it\'s PK to product command by using <

2条回答
  •  暖寄归人
    2020-12-22 02:02

    This error has nothing to do with tag Still There are few things missing in your code which is resulting this error.

    1. In JSP you are trying to upload file along with form data so you need to have multipartResolver bean defined in spring context from common-fileupload.jar MultipartResolver Spring
    2. Controller method should be changed like this

    @RequestMapping(value="/productlist/addproduct" , method= RequestMethod.POST,consumes = {MediaType.MULTIPART_FORM_DATA_VALUE})
    public ModelAndView addProdt(@ModelAttribute("prdt") Product p,BindingResult bindingResult)
    

提交回复
热议问题