SSm分页查询
写分页的时候,不知道是哪里的问题,有这样一个异常;org.apache.ibatis.binding.BindingException: Parameter 'start' not found. Available parameters are [1, 0, param1, param2]
mapper.xml文件中的sql语句是这样的:
<select id="find" resultType="cn.com.bochy.vo.User">
select * from user limit #{start},#{pageSize};
</select>
controller中的find方法:
public class UserController {
@Resource
private UserService userService;
private Integer page;
private final Integer pageSize=3;
@RequestMapping("/user/find.action")
public void find (){
if(page==null){//判断是不是第一页
page=1;
}
int start=(page-1)*pageSize;
int countPage=userService.count(pageSize);//查询总页数的方法
List<User> list=userService.find(start,pageSize);
}