Advertisement
Guest User

Untitled

a guest
Apr 29th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 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"
  4. xmlns:context="http://www.springframework.org/schema/context"
  5. xmlns:mvc="http://www.springframework.org/schema/mvc"
  6. xmlns:tx="http://www.springframework.org/schema/tx"
  7. xsi:schemaLocation="http://www.springframework.org/schema/mvc
  8. http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
  9. http://www.springframework.org/schema/beans
  10. http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  11. http://www.springframework.org/schema/context
  12. http://www.springframework.org/schema/context/spring-context-3.0.xsd">
  13.  
  14. <context:component-scan base-package="br.com.caelum.tarefas" />
  15. <mvc:annotation-driven />
  16.  
  17. <mvc:default-servlet-handler/>
  18.  
  19. <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  20. <property name="prefix" value="/WEB-INF/views/"/>
  21. <property name="suffix" value=".jsp"/>
  22. </bean>
  23.  
  24. <mvc:interceptors>
  25. <bean class=
  26. "br.com.caelum.tarefas.interceptor.AutorizadorInterceptor" />
  27. </mvc:interceptors>
  28.  
  29. <bean id="mysqlDataSource" class="org.apache.commons.dbcp.BasicDataSource" >
  30. <property name="driverClassName" value="com.mysql.jdbc.Driver" />
  31. <property name="url" value="jdbc:mysql://localhost/fj21" />
  32. <property name="username" value="root" />
  33. <property name="password" value="123" />
  34. </bean>
  35.  
  36. <!-- gerenciamento de jpa pelo spring -->
  37. <bean id="entityManagerFactory"
  38. class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
  39. <property name="dataSource" ref="mysqlDataSource" />
  40. <property name="jpaVendorAdapter">
  41. <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" />
  42. </property>
  43. </bean>
  44. <!-- gerenciamento da transação pelo spring -->
  45. <bean id="transactionManager"
  46. class="org.springframework.orm.jpa.JpaTransactionManager">
  47. <property name="entityManagerFactory" ref="entityManagerFactory"/>
  48. </bean>
  49.  
  50.  
  51. <tx:annotation-driven/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement