![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spring
ChainBlocker
这个作者很懒,什么都没留下…
展开
-
HTTP Status 500 - Request processing failed; nested exception is com.alibaba.dubbo.rpc.RpcException
HTTP Status 500 - Request processing failed; nested exception is com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method findAll in the service com.offcn.sellergoods.service.BrandService. Tried 3 times of the providers [10.10.115.162:20881] (1/1) f原创 2020-11-10 20:29:35 · 463 阅读 · 0 评论 -
spring整合JDBC&servlet&dbutils&常用数据源
目录spring整合JDBC8. 集成servletspring集成dbutils常用数据源spring整合JDBC1. 创建一个maven web工程2. 引入依赖<properties> <spring.version>4.3.0.RELEASE</spring.version> </properties> <dependencies> <dependen原创 2020-10-28 21:46:43 · 299 阅读 · 0 评论 -
Bean的应用范围&属性的注入方式
Bean的应用范围 AbstractApplicationContext ctx= new ClassPathXmlApplicationContext("applicationContext.xml"); PersonDao personDao1=(PersonDao)ctx.getBean("personDao"); PersonDao personDao2=(PersonDao)ctx.getBean("personDao");所上述演示中,取两次相同原创 2020-10-28 21:05:45 · 110 阅读 · 0 评论 -
定义bean的初始化和销毁方法&延迟加载
控制反转(IOC)应用程序本身不负任依赖对象的创建,依赖对象的创建由应用程序内转移动应用程序外(spring容中创建象)这种创建对象权力的转移就是反转。public class PersonDaoImpl implements PersonDao { public PersonDaoImpl(){ System.out.println("PersonDaoImpl被初始化"); } public void init(){ System.o原创 2020-10-28 20:23:30 · 227 阅读 · 0 评论 -
实例化bean的三种方式
1. 在核心配置文件中使用bean标签<bean id="personDao" class="cn.offcn.dao.impl.PersonDaoImpl"></bean>2. 以工厂的静态方法进行实例化public class BeanFactory { public static PersonDao createPersonDao(){ return new PersonDaoImpl(); }}<bean id原创 2020-10-28 19:37:15 · 177 阅读 · 0 评论 -
模拟IOC
以属性文件的方式模拟IOC1. 创建properties文件在resources目录下创建一个properties属性文件2. 编写自己的spring容器public class SpringApplicationContext { private Map<String,Object> map=new HashMap<String,Object>(); public SpringApplicationContext(String fileN原创 2020-10-28 19:14:12 · 213 阅读 · 0 评论 -
Spring入门案例
目录Spring介绍Spring入门案例1. 创建一个maven项目2. 引入依赖3. 创建spring核心配置文件4. 创建接口和实现类5. 实例化spring容器实现步骤:Spring介绍Spring框架是由于软件开发的复杂性而创建的。Spring使用的是基本的JavaBean来完成以前只可能由EJB完成的事情。然而,Spring的用途不仅仅限于服务器端的开发。从简单性、可测试性和松耦合性角度而言,绝大部分Java应用都可以从Spring中受益。Spring入原创 2020-10-28 18:50:53 · 187 阅读 · 0 评论