Spring3自定义环境配置 <beans profile="">
<beans profile="test"><jdbc:embedded-database id="dataSource"><jdbc:script location="classpath:com/bank/config/sql/schema.sql"/></jdbc:embedded-database></beans><beans profile="production"><jee:jndi-lookup id="dataSource" jndi-name="java:comp/env/jdbc/datasource"/></beans>?
2.在web.xml里,你需要定义使用的profile,最聪明的做法是定义成context-param,注意这里定义的是default值,在非生产环境,可以用系统变量"spring.profiles.active"进行覆盖。
<context-param><param-name>spring.profiles.default</param-name><param-value>production</param-value></context-param>?
System.setProperty("spring.profiles.active", "development");server.start()?
@ContextConfiguration(locations = { "/applicationContext.xml" })@ActiveProfiles("test")public class AccountDaoTest extends SpringTxTestCase {}?
?
详情:https://github.com/springside/springside4/wiki/Spring
?
详细配置与使用:http://www.cnblogs.com/chanedi/archive/2012/01/12/2320837.html
?