Guest User

Untitled

a guest
Dec 1st, 2015
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 3.24 KB | None | 0 0
  1. <beans xmlns="http://www.springframework.org/schema/beans"
  2.     xmlns:mvc="http://www.springframework.org/schema/mvc"
  3.     xmlns:context="http://www.springframework.org/schema/context"
  4.     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  5.     xmlns:tx="http://www.springframework.org/schema/tx"
  6.     xsi:schemaLocation="
  7.        http://www.springframework.org/schema/beans    
  8.        http://www.springframework.org/schema/beans/spring-beans.xsd
  9.        http://www.springframework.org/schema/mvc
  10.        http://www.springframework.org/schema/mvc/spring-mvc.xsd
  11.        http://www.springframework.org/schema/context
  12.        http://www.springframework.org/schema/context/spring-context.xsd
  13.        http://www.springframework.org/schema/tx
  14.        http://www.springframework.org/schema/tx/spring-tx.xsd">
  15.  
  16.     <tx:annotation-driven transaction-manager="transactionManager" />
  17.     <context:component-scan base-package="pl.wisecode" />
  18.     <mvc:annotation-driven/>
  19.     <mvc:resources mapping="/resources/**" location="/resources/" />
  20.     <context:annotation-config />
  21.    
  22.     <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  23.         <property name="location">
  24.             <value>classpath:app.properties</value>
  25.         </property>
  26.     </bean>
  27.    
  28.    
  29.     <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
  30.         <!-- Connection properties -->
  31.         <property name="driverClass" value="${driverClass}" />
  32.         <property name="jdbcUrl" value="${jdbcUrl}" />
  33.         <property name="user" value="${user}" />
  34.         <property name="password" value="${password}" />
  35.         <!-- Pool properties -->
  36.         <property name="minPoolSize" value="5" />
  37.         <property name="maxPoolSize" value="20" />
  38.         <property name="acquireIncrement" value="1" />
  39.         <property name="maxStatements" value="50" />
  40.         <property name="idleConnectionTestPeriod" value="3000" />
  41.         <property name="loginTimeout" value="300" />
  42.     </bean>
  43.  
  44.     <bean id="entityManagerFactory"
  45.      class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
  46.         <property name="dataSource" ref="dataSource" />
  47.         <property name="packagesToScan" value="pl.wisecode.model" />
  48.         <property name="jpaVendorAdapter">
  49.             <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
  50.                 <property name="showSql" value="true" />
  51.                 <property name="databasePlatform" value="org.hibernate.dialect.MySQLDialect" />
  52.             </bean>
  53.         </property>
  54.         <property name="jpaProperties">
  55.             <props>
  56.                 <prop key="hibernate.hbm2ddl.auto">update</prop>
  57.             </props>
  58.         </property>
  59.     </bean>
  60.     <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
  61.     <bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />
  62.     <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
  63.         <property name="entityManagerFactory" ref="entityManagerFactory" />
  64.     </bean>
  65.    
  66.     <bean id="viewResolver"
  67.         class="org.springframework.web.servlet.view.UrlBasedViewResolver">
  68.         <property name="viewClass"
  69.             value="org.springframework.web.servlet.view.JstlView" />
  70.         <property name="prefix" value="/WEB-INF/jsp/" />
  71.         <property name="suffix" value=".jsp" />
  72.     </bean>
  73.  
  74.    
  75.  
  76. </beans>
Advertisement
Add Comment
Please, Sign In to add comment