`
zaife
  • 浏览: 40477 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

杂项

    博客分类:
  • java
阅读更多

spring数据源配置

  1. <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"  singleton="true">  
  2.      <property name="jndiName">  
  3.          <value>tempDS</value>  
  4.      </property>  
  5. </bean>  

 

spring 整合 iBatis

  1. <bean id="sqlMapClient"  
  2.         class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">  
  3.     <property name="configLocation">  
  4.         <value>/WEB-INF/sql-map-config.xml</value>  
  5.     </property>  
  6.     <property name="dataSource" ref="dataSource" />  
  7. </bean>  

 

web.xml   中 spring (一种方式)

  1. <context-param>  
  2.     <param-name>contextConfigLocation</param-name>  
  3.     <param-value>  
  4.         /WEB-INF/spring-config-global.xml   
  5.     </param-value>  
  6. </context-param>  
  7.   
  8. <listener>  
  9.     <listener-class>  
  10.         org.springframework.web.context.ContextLoaderListener   
  11.     </listener-class>  
  12. </listener>  
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics