做批量删除时遇见的问题:
org.apache.ibatis.binding.BindingException: Parameter 'ids' not found. Available parameters are [array]
前台jsp页面的ajax请求可以进入:
![捕获.PNG wKiom1muXDmi2oOPAABPh32vnmU446.png-wh_50](https://s3.51cto.com/wyfs02/M01/05/EA/wKiom1muXDmi2oOPAABPh32vnmU446.png-wh_500x0-wm_3-wmp_4-s_548886858.png)
![捕获.PNG wKiom1muXV2CmamcAAEb5blAiok417.png-wh_50](https://s3.51cto.com/wyfs02/M01/05/EA/wKiom1muXV2CmamcAAEb5blAiok417.png-wh_500x0-wm_3-wmp_4-s_3701425037.png)
但是点击批量删除的按钮时会报这个错误:
![捕获.PNG wKiom1muXcagfU4ZAAIAsqLlRDU952.png-wh_50](https://s4.51cto.com/wyfs02/M02/05/EA/wKiom1muXcagfU4ZAAIAsqLlRDU952.png-wh_500x0-wm_3-wmp_4-s_1096408365.png)
后来发现是Mapper中的collection定义错了:
![捕获.PNG wKiom1muXrLh__e-AADxGInrJeQ525.png-wh_50](https://s2.51cto.com/wyfs02/M01/05/EA/wKiom1muXrLh__e-AADxGInrJeQ525.png-wh_500x0-wm_3-wmp_4-s_1153341417.png)
把<foreach>标签中的collection="ids"改为collection="array"即可。
转载于:https://blog.51cto.com/13142162/1962868