Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:mvc="http://www.springframework.org/schema/mvc"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns="http://www.springframework.org/schema/beans"
- xmlns:context="http://www.springframework.org/schema/context"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context.xsd
- http://www.springframework.org/schema/mvc
- http://www.springframework.org/schema/mvc/spring-mvc.xsd">
- <context:component-scan base-package="com.kuzia.controller"/>
- <mvc:resources mapping="/resourses/**" location="/resourses/" />
- <mvc:annotation-driven/>
- <bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping" />
- <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
- <property name="prefix">
- <value>/WEB-INF/jsp/</value>
- </property>
- <property name="suffix">
- <value>.jsp</value>
- </property>
- </bean>
- <context:component-scan base-package="com.kuzia"/>
- <bean id = "dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
- <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
- <property name="url" value="jdbc:mysql://localhost:3306/basesites"/>
- <property name="username" value="root"/>
- <property name="password" value="root"/>
- </bean>
- <bean id = "sessionFactory" class = "org.springframework.orm.hibernate5.LocalSessionFactoryBean">
- <property name="dataSource" ref="dataSource"/>
- <property name="packagesToScan" value="com.kuzia.model"/>
- <property name="hibernateProperties">
- <value>
- hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
- hibernate.show_sql=true
- </value>
- </property>
- </bean>
- <bean id="entityManagerFactoryBean" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
- <property name="dataSource" ref="dataSource"/>
- <property name="packagesToScan" value="com.kuzia.model"/>
- <!-- JpaVendorAdapter implementation for Hibernate EntityManager.
- Exposes Hibernate's persistence provider and EntityManager extension interface -->
- <property name="jpaVendorAdapter">
- <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"/>
- </property>
- <property name="jpaProperties">
- <props>
- <prop key="hibernate.hbm2ddl.auto">update</prop>
- <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
- </props>
- </property>
- </bean>
- <tx:annotation-driven transaction-manager="tx" proxy-target-class="true"/>
- <bean id = "tx" class = "org.springframework.orm.hibernate5.HibernateTransactionManager">
- <property name="sessionFactory" ref="sessionFactory"/>
- </bean>
- <bean id = "userDAO" class="com.kuzia.dao.impl.UserDAOImpl"/>
- <bean id = "userService" class = "com.kuzia.service.impl.UserServiceImpl"/>
- <bean id = "messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
- <property name="basename" value="classpath:messages"/>
- <property name="defaultEncoding" value="UTF-8"/>
- </bean>
- <bean id = "localeChangeInterceptor" class = "org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
- <property name="paramName" value="lang"/>
- </bean>
- <bean id = "localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
- <property name="defaultLocale" value="en"/>
- </bean>
- <mvc:interceptors>
- <bean class = "org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
- <property name="paramName" value="lang"/>
- </bean>
- </mvc:interceptors>
- </beans>
Add Comment
Please, Sign In to add comment