applicationContext.xml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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:p="http://www.springframework.org/schema/p"
  4. xmlns:context="http://www.springframework.org/schema/context"
  5. xmlns:util="http://www.springframework.org/schema/util"
  6. xsi:schemaLocation="
  7. http://www.springframework.org/schema/beans
  8. http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  9. http://www.springframework.org/schema/context
  10. http://www.springframework.org/schema/context/spring-context-3.0.xsd
  11. http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
  12. <!-- bean id="corsFilter" class="filters.CORSFilter" / -->
  13. <bean id="hibernateProperties"
  14. class="org.springframework.beans.factory.config.PropertiesFactoryBean">
  15. <property name="locations">
  16. <list>
  17. <value>/WEB-INF/properties/hibernate.properties</value>
  18. </list>
  19. </property>
  20. </bean>
  21. <bean id="sessionFactory"
  22. class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
  23. <property name="configLocation">
  24. <value>/WEB-INF/hibernate.cfg.xml</value>
  25. </property>
  26. <!-- <property name="configurationClass"> -->
  27. <!-- <value>org.hibernate.cfg.AnnotationConfiguration</value> -->
  28. <!-- </property> -->
  29. <property name="hibernateProperties">
  30. <ref bean="hibernateProperties" />
  31. </property>
  32. </bean>
  33. <!-- Definizione del gestore delle transazioni di hibernate -->
  34. <bean id="serviceTransactionManager"
  35. class="org.springframework.orm.hibernate4.HibernateTransactionManager">
  36. <property name="sessionFactory">
  37. <ref bean="sessionFactory" />
  38. </property>
  39. </bean>
  40. <context:property-placeholder location="/WEB-INF/properties/app.properties"/>
  41. <util:properties id="appProperties"
  42. location="/WEB-INF/properties/app.properties" />
  43. </beans>