Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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:aop="http://www.springframework.org/schema/aop"
- xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:util="http://www.springframework.org/schema/util" 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/aop http://www.springframework.org/schema/aop/spring-aop.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.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">
- <!-- Database Connection pool -->
- <bean id="dataSource1" class="com.zaxxer.hikari.HikariDataSource">
- <property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
- <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/cloudms"></property>
- <property name="username" value="admin"></property>
- <property name="password" value="admin"></property>
- <property name="autoCommit" value="false"></property>
- </bean>
- <bean id="transactionManager"
- class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
- <property name="dataSource" ref="dataSource1"></property>
- </bean>
- <!-- Configure JdbcTemplate -->
- <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
- <property name="dataSource" ref="dataSource1"></property>
- </bean>
- <bean id="flightsRepository" class="com.myapp.spring.mvc.dao.flightsairlineimpl"
- autowire="constructor">
- </bean>
- <!-- View Resolver -->
- <!-- JSP + JSTL View -->
- <bean id="viewResolver"
- class="org.springframework.web.servlet.view.InternalResourceViewResolver">
- <property name="prefix" value="/WEB-INF/jsp/"></property>
- <property name="suffix" value=".jsp"></property>
- </bean>
- <!-- Aspect -->
- <tx:advice id="txAdvice" transaction-manager="transactionManager">
- <tx:attributes>
- <!-- all methods starting with 'list' or 'get' are read-only -->
- <tx:method name="search*" propagation="REQUIRED" />
- </tx:attributes>
- </tx:advice>
- <aop:config>
- <aop:advisor pointcut-ref="serviceMethods" advice-ref="txAdvice" />
- <aop:aspect>
- <aop:pointcut id="serviceMethods"
- expression="execution(* com.myapp.spring.mvc.dao.*.*(..))" />
- </aop:aspect>
- </aop:config>
- <context:component-scan base-package="com.myapp.spring.mvc.*" />
- <!-- <context:property-placeholder location="classpath:application.properties" /> -->
- <mvc:annotation-driven />
- <mvc:resources mapping="/resources/**" location="/resources/" />
- </beans>
Add Comment
Please, Sign In to add comment