Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:p="http://www.springframework.org/schema/p"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xmlns:mvc="http://www.springframework.org/schema/mvc"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context-3.2.xsd
- http://www.springframework.org/schema/aop
- http://www.springframework.org/schema/aop/spring-aop-3.2.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-3.2.xsd">
- <bean id="viewResolver"
- class="org.springframework.web.servlet.view.InternalResourceViewResolver">
- <property name="prefix" value="/WEB-INF/jsp/" />
- <property name="suffix" value=".jsp" />
- </bean>
- <!-- Scans the classpath for annotated components that will be auto-registered as Spring beans -->
- <!-- context:component-scan base-package="br.com.siscad.dao" />
- <context:component-scan base-package="br.com.siscad.services" /-->
- <context:component-scan base-package="br.com.siscad.controllers" />
- <!-- Activates various annotations to be detected in bean classes e.g: @Autowired -->
- <context:annotation-config />
- <mvc:annotation-driven />
- <mvc:default-servlet-handler />
- <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
- <property name="driverClassName" value="org.postgresql.Driver" />
- <property name="url" value="jdbc:postgresql://localhost/siscad" />
- <property name="username" value="postgres" />
- <property name="password" value="pedro123" />
- </bean>
- <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
- <property name="dataSource" ref="dataSource" />
- <property name="persistenceUnitName" value="siscad" />
- </bean>
- <!-- Transactions -->
- <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
- <property name="entityManagerFactory" ref="entityManagerFactory" />
- </bean>
- <!-- enable the configuration of transactional behavior based on annotations -->
- <tx:annotation-driven transaction-manager="transactionManager" />
- <mvc:interceptors>
- <bean class="interceptores.AutorizadorInterceptor" />
- </mvc:interceptors>
- <bean id="persistenceExceptionTranslationPostProcessor"
- class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />
- </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement