24,923
社区成员




<bean id="itemsService" class="ssm.check.service.impl.ItemsServiceImpl" >
</bean>
@Controller
public class ItemsController {
@Autowired
private ItemsService itemsService;
@RequestMapping("/findItemsByName")
public ModelAndView findItemsByName() {
List<ItemsCustom> itemsList = itemsService.findItemsByName(null);
ModelAndView modelAndView = new ModelAndView();
modelAndView.addObject("itemsList", itemsList);
// 视图
modelAndView.setViewName("WEB-INF/jsp/items/itemsList.jsp");
return modelAndView;
}
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private ssm.check.mapper.ItemsCustomMapper ssm.check.service.impl.ItemsServiceImpl.itemsCustomMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [ssm.check.mapper.ItemsCustomMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}