上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 20 下一页
摘要: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:sc 阅读全文
posted @ 2020-07-11 21:23 阿布都日 阅读(154) 评论(0) 推荐(0) 编辑
摘要: driverClass=org.h2.Driver jdbcUrl=jdbc:h2:file:~/.h2/h2 user=root password=123456 阅读全文
posted @ 2020-07-11 20:38 阿布都日 阅读(2041) 评论(0) 推荐(0) 编辑
摘要: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance 阅读全文
posted @ 2020-07-11 18:50 阿布都日 阅读(329) 评论(0) 推荐(0) 编辑
摘要: 用于创建对象==<bean> value属性指定值,默认值是当前类名-首字母小写 1. @Component2. @Controller:表现层3. @Service:业务层4. @Repository:持久层 用于注入数据==<property>1. @Autowired:类型匹配->名称匹配2. 阅读全文
posted @ 2020-07-11 18:46 阿布都日 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 复杂类型: 1. 数组 2. List 3. Set 4. Map 5. Properties <!--array,list,map,props,set标签用于注入集合类型--> <bean id="accountService" class="com.example.service.impl.Ac 阅读全文
posted @ 2020-07-11 18:27 阿布都日 阅读(54) 评论(0) 推荐(0) 编辑
摘要: <!--property标签用于初始化bean对象--> <!--name:set方法名定位--> <!--value:注入基本类型和string类型 ref:注入bean对象--> <bean id="accountService" class="com.example.service.impl. 阅读全文
posted @ 2020-07-11 18:07 阿布都日 阅读(321) 评论(0) 推荐(0) 编辑
摘要: <!--constructor-arg标签用于初始化bean对象--> <!--type:类型定位 index:位置定位 name:形参名定位--> <!--value:注入基本类型和string类型 ref:注入bean对象--> <bean id="accountService" class=" 阅读全文
posted @ 2020-07-11 18:02 阿布都日 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 依赖注入: 可注入数据: 1. 基本类型+String 2. Bean对象 3. 集合类型 注入方式: 1. 构造函数注入 2. set方法注入 3. 注解注入 阅读全文
posted @ 2020-07-11 17:54 阿布都日 阅读(97) 评论(0) 推荐(0) 编辑
摘要: Bean的三种创建方式 <!--方式一:默认构造函数创建--> <bean id="accountService" class="com.example.service.impl.AccountServiceImpl"></bean> <!--方式二:使用普通工厂创建--> <bean id="in 阅读全文
posted @ 2020-07-11 17:30 阿布都日 阅读(299) 评论(0) 推荐(0) 编辑
摘要: Resource resource = new ClassPathResource("bean.xml"); BeanFactory factory = new XmlBeanFactory(resource); 阅读全文
posted @ 2020-07-11 15:29 阿布都日 阅读(215) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 20 下一页