2023-09-07
applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> <context:component-scan base-package="com.hh"/> </beans>
BookDaoImpl简单测试示例
@Repository("bookDao") public class BookDaoImpl implements BookDao { @Override public void save() { System.out.println("BookDaoImpl save"); } }
BookServiceImpl简单测试示例
@Service("bookService") public class BookServiceImpl implements BookService { private BookDao bookDao; public void setBookDao(BookDao bookDao) { this.bookDao = bookDao; } @Override public void save() { System.out.println("BookServiceImpl save"); } }
标签:xml,applicationContext,BookDaoImpl,bookDao,注解,save,public From: https://www.cnblogs.com/isDaHua/p/17684472.html