随笔分类 - Spring
摘要:pom.xml web.xml配置 spring-mvc.xml applicationContext.xml
阅读全文
摘要:CGLIB代理 配置文档 1 <bean id="logProxy" class="org.springframework.aop.framework.ProxyFactoryBean"> 2 <property name="proxyTargetClass"> 3 <value>true</val
阅读全文
摘要:Spring通知 Interception Around通知 MethodInterceptor类(方法执行前后通知) Before通知 MethodBeforeAdvice类(方法执行前通知) After Returning通知 AfterReturningAdvice类(方法执行后通知) Thr
阅读全文
摘要:1、国际化支持 getMessage()提供了国际化支持。 Bean中必须定义为messageSource。 <bean id="messageSource" class="org.springfarmework.comtext.support.ResourceBundleMessage-Sourc
阅读全文
摘要:BeanWrapper BeanFactory ApplicationContext 1、通常情况下使用BeanFactory、ApplicationContext 2、ApplicationContext包含了BeanFactory相关功能是超集。
阅读全文
摘要:List、Set、Map、Properties 1、List <property name="msg"> <list> <value>gf</value> <value>gd</value> <value>HelloWorld</value> </list> </property> 2、Set <p
阅读全文
摘要:自动化装配使得研发减少了响应的指配工作,但是使得响应的检查难以完成。 解决方法: simple模式: <bean autowire="autodetect" dependency-check="simple"> 1、基本类型、字符串和集合进行依赖检查。 object模式:<bean autowire
阅读全文
摘要:byName模式<bean autowire="byName"> Spring会查找一个叫做date的bean定义。 byType模式<bean autowire="byType"> 1、Spring会查找bean中类型和Date相同类型的bean进行赋值。 2、如果发现多个就会抛出异常。 3、如果
阅读全文
摘要:local属性 1、被引用id必须在同一个xml中。 2、被引用id必须使用id命名。 优点提前检查所使用的bean id是否正确。 Bean属性 1、Bean指定的id可以在不同的xml中。 2、Bean指定的id 所对应的bean可以使id或name。 parent属性
阅读全文
摘要:Bean初始化 1、bean中实现public void init();方法,config.xml中增加init-method="init" 属性。 2、bean实现接口InitializingBean,实现方法afterPropertiesSet,配置文件无需改动。 Bean的使用 1、 Hell
阅读全文
摘要:1、支持的注入方式 构建注入,set注入 2、bean属性 id、name、class、singleton(true、false)、depends-on="date"(初始化依赖) 3、property(name) <value></value>,<ref bean="date"/>,<bean i
阅读全文

浙公网安备 33010602011771号