Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:mvc="http://www.springframework.org/schema/mvc"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/mvc
- http://www.springframework.org/schema/mvc/spring-mvc.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context.xsd
- http://www.springframework.org/schema/tx
- http://www.springframework.org/schema/tx/spring-tx.xsd">
- <tx:annotation-driven transaction-manager="transactionManager" />
- <context:component-scan base-package="pl.wisecode" />
- <mvc:annotation-driven/>
- <mvc:resources mapping="/resources/**" location="/resources/" />
- <context:annotation-config />
- <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
- <property name="location">
- <value>classpath:app.properties</value>
- </property>
- </bean>
- <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
- <!-- Connection properties -->
- <property name="driverClass" value="${driverClass}" />
- <property name="jdbcUrl" value="${jdbcUrl}" />
- <property name="user" value="${user}" />
- <property name="password" value="${password}" />
- <!-- Pool properties -->
- <property name="minPoolSize" value="5" />
- <property name="maxPoolSize" value="20" />
- <property name="acquireIncrement" value="1" />
- <property name="maxStatements" value="50" />
- <property name="idleConnectionTestPeriod" value="3000" />
- <property name="loginTimeout" value="300" />
- </bean>
- <bean id="entityManagerFactory"
- class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
- <property name="dataSource" ref="dataSource" />
- <property name="packagesToScan" value="pl.wisecode.model" />
- <property name="jpaVendorAdapter">
- <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
- <property name="showSql" value="true" />
- <property name="databasePlatform" value="org.hibernate.dialect.MySQLDialect" />
- </bean>
- </property>
- <property name="jpaProperties">
- <props>
- <prop key="hibernate.hbm2ddl.auto">update</prop>
- </props>
- </property>
- </bean>
- <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
- <bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />
- <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
- <property name="entityManagerFactory" ref="entityManagerFactory" />
- </bean>
- <bean id="viewResolver"
- class="org.springframework.web.servlet.view.UrlBasedViewResolver">
- <property name="viewClass"
- value="org.springframework.web.servlet.view.JstlView" />
- <property name="prefix" value="/WEB-INF/jsp/" />
- <property name="suffix" value=".jsp" />
- </bean>
- </beans>
Advertisement
Add Comment
Please, Sign In to add comment