Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:mvc="http://www.springframework.org/schema/mvc"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
- <context:component-scan base-package="net.revisorsystem"/>
- <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
- <property name="prefix" value="/WEB-INF/pages/"/>
- <property name="suffix" value=".jsp"/>
- </bean>
- <!-- Database Information -->
- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
- destroy-method="close">
- <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
- <property name="url"
- value="jdbc:mysql://localhost:3306/revisorsystem"/>
- <property name="username" value="root"/>
- <property name="password" value="160298"/>
- </bean>
- <!-- Hibernate 4 SessionFactory Bean definition -->
- <bean id="hibernate4AnnotatedSessionFactory"
- class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
- <property name="dataSource" ref="dataSource"/>
- <property name="annotatedClasses">
- <list>
- <value>net.revisorsystem.model.Owner</value>
- </list>
- </property>
- <property name="hibernateProperties">
- <props>
- <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect
- </prop>
- <prop key="hibernate.show_sql">true</prop>
- </props>
- </property>
- </bean>
- <!--BookDao and BookService beans-->
- <bean id="ownerDao" class="net.revisorsystem.dao.OwnerDaoImpl">
- <property name="sessionFactory" ref="hibernate4AnnotatedSessionFactory"/>
- </bean>
- <bean id="ownerService" class="net.revisorsystem.service.OwnerServiceImpl">
- <property name="ownerDao" ref="ownerDao"/>
- </bean>
- <context:component-scan base-package="net.revisorsystem"/>
- <tx:annotation-driven transaction-manager="transactionManager"/>
- <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
- <property name="sessionFactory" ref="hibernate4AnnotatedSessionFactory"/>
- </bean>
- <mvc:default-servlet-handler/>
- <mvc:annotation-driven/>
- </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement