Skip to content

Instantly share code, notes, and snippets.

@jasoet
Created May 13, 2011 08:12
Show Gist options
  • Save jasoet/970186 to your computer and use it in GitHub Desktop.
Save jasoet/970186 to your computer and use it in GitHub Desktop.
Spring Application Context
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
">
<aop:aspectj-autoproxy />
<context:component-scan base-package="chapter09.code.listing" />
<jee:jndi-lookup jndi-name="java:comp/env/jdbc/myportalDB"
id="dataSource" />
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="annotatedClasses">
<list>
<value>chapter09.code.listing.domain.ToC</value>
<value>chapter09.code.listing.domain.Book</value>
<value>chapter09.code.listing.domain.AuditFields</value>
</list>
</property>
</bean>
<tx:annotation-driven transaction-manager="txManager" />
<bean id="txManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="auditFieldAspect" class="chapter09.code.listing.base.AuditAspect" />
<bean id="loggingAspect" class="chapter09.code.listing.base.LoggingAspect" />
</beans>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment