Spring知识点回顾(08)spring aware】的更多相关文章

Spring知识点回顾(08)spring aware BeanNameAware 获得容器中的bean名称 BeanFactoryAware 获得当前的bean factory ApplicationContextAware 获得当前的ApplicationContext MessageResourceAware 获得messageresource,可以获得文本消息 ApplicationEventPublisherAware 应用事件发布器,可以发布事件 ResourceLoaderAwar…
Spring知识点回顾(07)事件发布和监听 1.DemoEvent extends ApplicationEvent { public DemoEvent(Object source, String msg){ super(source); this.msg = msg; } } 2.DemoListener implements ApplicationEventListener<DemoEvent> { public void onApplicationEvent(DemoEvent ev…
Spring知识点回顾(01) 一.Java Config 1.服务和服务注入 2.Java 注解 :功能更强一些 3.测试验证 二.注解注入 1.服务和服务注入 2.配置加载 3.测试验证 三.总结和建议 1.配置方式 声明Bean的注解 @Component @Service @Repository @Controller 注入Bean的注解 @Autowired @Inject @Resource bean的配置扫描 @Configuration 和  @Bean: 用@Configura…
1.设定环境中的active profiles 如:DispatcherServerlet的init-param spring.profiles.active=production spring.profiles.active=dev 如: public class WebInit implements WebApplicationInitializer { @Override public void onStartup(ServletContext sc) { sc.setInitParame…
 1. 回顾JDBC        a. java操作关系型数据的API.导入相关数据库的驱动包后可以通过JDBC提供的接口来操作数据库.        b. 实现JDBC的六个步骤            注册数据库驱动            获取数据库连接            获取传输器对象            传输sql执行获取结果集对象            遍历结果集获取信息            关闭资源        c. 数据库连接池(数据源) C3P0连接池 2.Spring…
Java配置方式:@Bean @InitMethod @destroyMethod xml配置方式:init-method,destroy-method 注解方式:@PostConstruct,@PreDestroy…
注入普通字符 注入操作系统属性 注入表达式运算结果 注入其他bean属性 注入文件内容 注入网址内容 注入属性文件…
sigleton prototype request session globalsession stepscope…
一.注解拦截 二.方法规则拦截…
Spring 知识点提炼 1. Spring框架的作用 轻量:Spring是轻量级的,基本的版本大小为2MB 控制反转:Spring通过控制反转实现了松散耦合,对象们给出它们的依赖,而不是创建或查找依赖的对象们. 面向切面的编程AOP:Spring支持面向切面的编程,并且把应用业务逻辑和系统服务分开. 容器:Spring包含并管理应用中对象的生命周期和配置 MVC框架: Spring-MVC 事务管理:Spring提供一个持续的事务管理接口,可以扩展到上至本地事务下至全局事务JTA 异常处理:S…