Advertisement
Guest User

Untitled

a guest
Aug 15th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 3.32 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3.       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
  4.       xmlns:context="http://www.springframework.org/schema/context"
  5.       xmlns:jee="http://www.springframework.org/schema/jee" xmlns:lang="http://www.springframework.org/schema/lang"
  6.       xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx"
  7.       xmlns:util="http://www.springframework.org/schema/util" xmlns:mvc="http://www.springframework.org/schema/mvc"
  8.       xsi:schemaLocation="
  9.        http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
  10.        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  11.        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
  12.        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
  13.        http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
  14.        http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd
  15.        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
  16.        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
  17.  
  18.  
  19.     <mvc:annotation-driven/>
  20.     <mvc:resources mapping="/resources/**" location="/resources/"/>
  21.     <context:annotation-config />
  22.     <context:component-scan base-package="ru.javarush" />
  23.  
  24.  
  25.     <bean id="propertyConfigurer"
  26.          class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
  27.          p:location="/WEB-INF/jdbc.properties" />
  28.  
  29.     <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
  30.          destroy-method="close" p:driverClassName="${jdbc.driverClassName}"
  31.          p:url="${jdbc.databaseurl}" p:username="${jdbc.username}" p:password="${jdbc.password}" />
  32.     <bean id="sessionFactory"
  33.          class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
  34.         <property name="dataSource" ref="dataSource" />
  35.         <property name="configLocation">
  36.             <value>classpath:hibernate.cfg.xml</value>
  37.         </property>
  38.         <property name="configurationClass">
  39.             <value>org.hibernate.cfg.AnnotationConfiguration</value>
  40.         </property>
  41.         <property name="hibernateProperties">
  42.             <props>
  43.                 <prop key="hibernate.dialect">${jdbc.dialect}</prop>
  44.                 <prop key="hibernate.show_sql">true</prop>
  45.             </props>
  46.         </property>
  47.     </bean>
  48.     <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
  49.         <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
  50.         <property name="prefix" value="/WEB-INF/jsp/"/>
  51.         <property name="suffix" value=".jsp"/>
  52.     </bean>
  53.     <tx:annotation-driven />
  54.     <bean id="transactionManager"
  55.          class="org.springframework.orm.hibernate3.HibernateTransactionManager">
  56.         <property name="sessionFactory" ref="sessionFactory" />
  57.     </bean>
  58. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement