Guest User

Untitled

a guest
Jun 20th, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.04 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
  4. xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
  5. xmlns:util="http://www.springframework.org/schema/util" xmlns:mvc="http://www.springframework.org/schema/mvc"
  6. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  7. http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
  8. 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">
  9.  
  10.  
  11.  
  12. <!-- Database Connection pool -->
  13. <bean id="dataSource1" class="com.zaxxer.hikari.HikariDataSource">
  14. <property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
  15. <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/cloudms"></property>
  16. <property name="username" value="admin"></property>
  17. <property name="password" value="admin"></property>
  18. <property name="autoCommit" value="false"></property>
  19. </bean>
  20.  
  21.  
  22. <bean id="transactionManager"
  23. class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  24. <property name="dataSource" ref="dataSource1"></property>
  25. </bean>
  26.  
  27.  
  28.  
  29. <!-- Configure JdbcTemplate -->
  30. <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
  31. <property name="dataSource" ref="dataSource1"></property>
  32. </bean>
  33.  
  34. <bean id="flightsRepository" class="com.myapp.spring.mvc.dao.flightsairlineimpl"
  35. autowire="constructor">
  36. </bean>
  37.  
  38. <!-- View Resolver -->
  39. <!-- JSP + JSTL View -->
  40. <bean id="viewResolver"
  41. class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  42. <property name="prefix" value="/WEB-INF/jsp/"></property>
  43. <property name="suffix" value=".jsp"></property>
  44. </bean>
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51. <!-- Aspect -->
  52.  
  53.  
  54. <tx:advice id="txAdvice" transaction-manager="transactionManager">
  55. <tx:attributes>
  56. <!-- all methods starting with 'list' or 'get' are read-only -->
  57. <tx:method name="search*" propagation="REQUIRED" />
  58.  
  59.  
  60. </tx:attributes>
  61. </tx:advice>
  62.  
  63. <aop:config>
  64. <aop:advisor pointcut-ref="serviceMethods" advice-ref="txAdvice" />
  65. <aop:aspect>
  66. <aop:pointcut id="serviceMethods"
  67. expression="execution(* com.myapp.spring.mvc.dao.*.*(..))" />
  68. </aop:aspect>
  69. </aop:config>
  70.  
  71.  
  72. <context:component-scan base-package="com.myapp.spring.mvc.*" />
  73.  
  74. <!-- <context:property-placeholder location="classpath:application.properties" /> -->
  75.  
  76. <mvc:annotation-driven />
  77.  
  78. <mvc:resources mapping="/resources/**" location="/resources/" />
  79.  
  80.  
  81.  
  82. </beans>
Add Comment
Please, Sign In to add comment