![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Spring
FFshanshi
这个作者很懒,什么都没留下…
展开
-
Spring注解开发
1.1Spring原始注解 Spring原始注解主要代替<Bean>的配置 @Component 使用在类上用于实例化Bean @Controller 使用在web层类上用于实例化Bean @Serice 试用下service层类上用于实例化Bean @Respository 使用在dao层类上用于实例化Bean ...原创 2021-09-17 14:40:43 · 42 阅读 · 0 评论 -
Spring相关的API
public Object getBean(String name) throws BeanException{ assertBeanFactoryActive(); return getBeanFactory().getBean(name); } public <T> T getBean(Class<T> requiredType) throws BeanException{ assertBeanFactoryActive(); return g.原创 2021-09-17 10:10:44 · 61 阅读 · 0 评论 -
Spring配置文件重要属性
<bean>标签 id属性:在容器中Bean实例的唯一标识,不允许重复 class属性:需要实例化的Bean的全路径名 scop属性:Bean的作用范围,常用Singleton(默认)和 prototype <proprtype>标签:依赖注入 name属性:需要注入的属性名称 value属性:注入的普通属性值 ...原创 2021-09-17 09:52:14 · 80 阅读 · 0 评论