03 2022 档案
摘要:创建 maven工程 在pom.xml引入依赖: <dependencies> <!-- SpringMVC --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId>
阅读全文
摘要:xml注解:注解和xml混合使用 <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XM
阅读全文
摘要:首先 dao层: dao -bookdao(interface) -bookdaoimpl service层: bookService 实体类对象 entiry-book 测试类 Test-TestBook 结构如图所示: xml配置: <?xml version="1.0" encoding="U
阅读全文
摘要:1.bean管理 -spring创建对象 -在spring的配置文件中,使用bean标签、标签里添加对应的属性、就可以实现对象的创建 -在bean标签中有很多属性 -id属性:唯一的标识 -class属性:类全路径(包类的路径) -创建对象的时候:默认无参 -spring注入属性2.基于xml方式注
阅读全文
摘要:xml的配置如下<bean id="userService" class="com.spring5.service.UserService"> <property name="userDAO" ref="userDAO"></property></bean><bean id="userDAO" cl
阅读全文