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 <
This is an old question but In case anyone else experiences the same issue then look how I solved it.
The problem has nothing to do with the post method that was provide. It is thrown by the next page that you are redirecting to ("redirect:/allProduct"
). Your ORM could not successfully map the database result to individual objects, this could be caused by not specifying a primary key or having keys that evaluate to null. So visit your database and fix it, make sure you have everything correct in the end.
This error has nothing to do with <form:select>
tag
Still There are few things missing in your code which is resulting this error.
@RequestMapping(value="/productlist/addproduct" , method= RequestMethod.POST,consumes = {MediaType.MULTIPART_FORM_DATA_VALUE})
public ModelAndView addProdt(@ModelAttribute("prdt") Product p,BindingResult bindingResult)