ITeye博客

杂项

zaife · 2007-11-07 17:40 · java · Spring · XML · iBATIS · Web · Bean · Markdown

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. <listener>
  8. <listener-class>
  9. org.springframework.web.context.ContextLoaderListener
  10. </listener-class>
  11. </listener>

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。