springmvc 删除

接口中的方法:

@Override
public void deleteProject(int id) {
String sql="delete from projectlisttable where id="+id;
jdbcTemplate.update(sql);
System.out.println("删除成功");

}

控制层的方法



// 删除数据
@RequestMapping(value = "/deletedata", method = RequestMethod.GET)


public String deletedata(ModelMap map, HttpServletRequest request) {
int id = Integer.parseInt(request.getParameter("id"));
System.out.println(id);
projectFindAllList.deleteProject(id);
List<ProjectAll> listall = projectFindAllList.findAll();
map.put("listall", listall);
return "table";
}


猜你喜欢

转载自blog.csdn.net/qq_21406125/article/details/80214257
今日推荐