I am new to spring. I am developing a CRUD application using spring jdbc template. I finished with the insert and select. but in the update, they encounter some problems. can anyone provide me a simple example of updating and deleting using jdbctemplate. thrks in advance.
MY CONTROLLER -
@RequestMapping(method = RequestMethod.GET) public String showUserForm(@ModelAttribute(value="userview") User user,ModelMap model) { List list=userService.companylist(); model.addAttribute("list",list); return "viewCompany"; } @RequestMapping( method = RequestMethod.POST) public String add(@ModelAttribute(value="userview") @Valid User user, BindingResult result) { userValidator.validate(user, result); if (result.hasErrors()) { return "viewCompany"; } else { userService.updateCompany(user); System.out.println("value updated"); return "updateSuccess"; }
when I click the update button, the edited values ββshould be updated in my DB according to the row id, my problem is how to match the row id from jsp to the controller.
smya.dsh
source share