ITeye博客

Spring framework

共 3 篇文章

juint4 struts2 spring3,action测试

[code="java"] import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import org.apache.struts2.StrutsSpringJUnit4TestCase; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframewo…

2015-01-30 17:37 · 软件测试 · 架构设计 · Spring framework

Spring component-scan

Spring component-scan <context:component-scan base-package="com.xyz"> <context:include-filter type="regex" expression="com\.xyz\.rest\.dao\..*DaoImpl" /> </context:component-scan> Element : component-scan Scans the classpath for annotated components that will be auto-registered as Spring beans. By …

2015-01-20 15:59 · Spring framework

spring default-lazy-init

spring在启动的时候,会默认加载会默认加载整个对象实例图,从初始化ACTION配置、到 service配置到dao配置、乃至到数据库连接、事务等等。这样可以减少web服务器在运行时的负担,但是对于开发者来说无疑是效率极低的一个设置了。 还好,spring提供了default-lazy-init属性,其配置形式如下,applicationContext.xml中: < beans default-lazy-init ="true" > < bean class ="org.xxxx.bean" > 。。。。。。 spring配置默认default-lazy-init为false,当配置为t…

2014-12-31 17:01 · Spring framework