คำถามติดแท็ก component-scan

8
หลายแพ็คเกจในบริบท: การสแกนคอมโพเนนต์, การกำหนดค่าสปริง
ฉันจะเพิ่มหลายแพ็คเกจในไฟล์ spring-servlet.xml ในcontext:component-scanองค์ประกอบได้อย่างไร ฉันเหนื่อย <context:component-scan base-package="z.y.z.service" base-package="x.y.z.controller" /> และ <context:component-scan base-package="x.y.z.service, x.y.z.controller" /> และ <context:component-scan base-package="x.y.z.service" /> <context:component-scan base-package="x.y.z.controller" /> แต่มีข้อผิดพลาด: org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [x.y.z.dao.daoservice.LoginDAO] found for dependency:
โดยการใช้ไซต์ของเรา หมายความว่าคุณได้อ่านและทำความเข้าใจนโยบายคุกกี้และนโยบายความเป็นส่วนตัวของเราแล้ว
Licensed under cc by-sa 3.0 with attribution required.