Subversion Repositories Integrator Subversion

Rev

Rev 216 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

<?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:mvc="http://www.springframework.org/schema/mvc"  
                xmlns:context="http://www.springframework.org/schema/context"  
                xmlns:jee="http://www.springframework.org/schema/jee"
                xmlns:tx="http://www.springframework.org/schema/tx"
                xsi:schemaLocation="  
                http://www.springframework.org/schema/mvc  
                http://www.springframework.org/schema/mvc/spring-mvc.xsd  
                http://www.springframework.org/schema/beans  
                http://www.springframework.org/schema/beans/spring-beans.xsd  
                http://www.springframework.org/schema/context  
                http://www.springframework.org/schema/context/spring-context.xsd
                http://www.springframework.org/schema/jee
                http://www.springframework.org/schema/jee/spring-jee.xsd
                http://www.springframework.org/schema/tx
                http://www.springframework.org/schema/tx/spring-tx.xsd">


        <import resource="spring-security.xml"/>
       
        <mvc:annotation-driven />
       
        <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">  
        <property name="prefix" value="/WEB-INF/"></property>  
        <property name="suffix" value=".jsp"></property>  
        </bean>
       
        <context:spring-configured />

        <context:annotation-config />
       
        <context:component-scan base-package="br.com.ec" />
    <context:component-scan base-package="*.jar!br.com.ec" />
       
        <!-- Pós-processador de anotações JPA -->
        <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
       
        <!-- Tradutor de exceções JPA -->
        <bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />
       
        <!-- BANCO DE DADOS (INTERNO) -->
        <jee:jndi-lookup id="dataSource" jndi-name="jdbc/sistemaEC" />
       
        <!-- Configuração da unidade de persistência -->
        <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
                <property name="dataSource" ref="dataSource" />
                <property name="persistenceUnitName" value="sistemaPU"/>
        </bean>

        <tx:annotation-driven transaction-manager="transactionManager" />
    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactory" />
        <!-- <property name="dataSource" ref="dataSource" /> -->
    </bean>
   
    <!-- Habilita suporte a bean validation -->
        <bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean" />
       
        <!-- Suporte a annotations @Controller e @RequestMapping a nível de classe --> <!-- RETIRADO APÓS ATUALIZAÇÃO DO SPRINGFRAMEWORK -->       
        <!-- <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/> -->
   
        <bean class="org.springframework.beans.factory.config.CustomScopeConfigurer">
            <property name="scopes">
                <map>
                    <entry key="view">
                        <bean class="br.com.ec.web.scope.ViewScope" />
                    </entry>
                </map>
            </property>
        </bean>
        <!-- BANCO DE DADOS (DEDICADO) -->
        <!-- <jee:jndi-lookup id="dataSource" jndi-name="jdbc/sisDS" /> -->
        <!-- BANCO DE DADOS (RANCHOVEIODABARRA) -->
        <!-- <jee:jndi-lookup id="dataSource" jndi-name="jdbc/sisRB" /> -->
</beans>