Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 3.07 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3.    xmlns:p="http://www.springframework.org/schema/p"
  4.    xmlns:context="http://www.springframework.org/schema/context"
  5.    xmlns:tx="http://www.springframework.org/schema/tx"
  6.    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  7.    xmlns:aop="http://www.springframework.org/schema/aop"
  8.    xmlns:mvc="http://www.springframework.org/schema/mvc"
  9.    xsi:schemaLocation="
  10.        http://www.springframework.org/schema/beans
  11.        http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
  12.        http://www.springframework.org/schema/context
  13.        http://www.springframework.org/schema/context/spring-context-3.2.xsd
  14.        http://www.springframework.org/schema/aop
  15.         http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
  16.        http://www.springframework.org/schema/tx
  17.        http://www.springframework.org/schema/tx/spring-tx.xsd
  18.        http://www.springframework.org/schema/mvc  
  19.         http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd">
  20.  
  21.  
  22.     <bean id="viewResolver"
  23.         class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  24.         <property name="prefix" value="/WEB-INF/jsp/" />
  25.         <property name="suffix" value=".jsp" />
  26.     </bean>
  27.  
  28.      
  29.     <!-- Scans the classpath for annotated components that will be auto-registered as Spring beans -->
  30.     <!-- context:component-scan base-package="br.com.siscad.dao" />
  31.    <context:component-scan base-package="br.com.siscad.services" /-->
  32.     <context:component-scan base-package="br.com.siscad.controllers" />
  33.    
  34.     <!-- Activates various annotations to be detected in bean classes e.g: @Autowired -->
  35.    
  36.     <context:annotation-config />
  37.    
  38.     <mvc:annotation-driven />
  39.    
  40.     <mvc:default-servlet-handler />
  41.    
  42.     <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  43.         <property name="driverClassName" value="org.postgresql.Driver" />
  44.         <property name="url" value="jdbc:postgresql://localhost/siscad" />
  45.         <property name="username" value="postgres" />
  46.         <property name="password" value="pedro123" />
  47.     </bean>
  48.      
  49.      
  50.     <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
  51.          <property name="dataSource" ref="dataSource" />
  52.          <property name="persistenceUnitName" value="siscad" />
  53.     </bean>
  54.    
  55.     <!-- Transactions -->
  56.     <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
  57.         <property name="entityManagerFactory" ref="entityManagerFactory" />
  58.     </bean>
  59.     <!-- enable the configuration of transactional behavior based on annotations -->
  60.     <tx:annotation-driven transaction-manager="transactionManager" />
  61.    
  62.     <mvc:interceptors>
  63.        <bean class="interceptores.AutorizadorInterceptor" />
  64.     </mvc:interceptors>
  65.    
  66.     <bean id="persistenceExceptionTranslationPostProcessor"
  67.         class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />
  68.    
  69. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement