org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'bookID' not found. Available parameters are [param1, bookId]解决问题

SSM中出现了org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'bookID' not found. Available parameters are [param1, bookId]

Books query(@Param("bookId") int bookId);

传递对象ID的时候使用的参数名是id,而在Mapper中用注解Param,导致了前端传递的id与这里不符合。不要添加Param注解,会根据对象的属性,自动赋值。去掉注解即可

猜你喜欢

转载自www.cnblogs.com/myblogswcz/p/12812539.html
今日推荐