Advertisement
Guest User

Untitled

a guest
Aug 12th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.14 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans:beans xmlns="http://www.springframework.org/schema/mvc"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:beans="http://www.springframework.org/schema/beans"
  5. xmlns:context="http://www.springframework.org/schema/context"
  6. xmlns:tx="http://www.springframework.org/schema/tx"
  7. xmlns:jdbc="http://www.springframework.org/schema/jdbc"
  8. xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
  9. http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  10. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
  11. http://www.springframework.org/schema/tx/spring-tx-4.3.xsd" >
  12.  
  13. <!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure -->
  14.  
  15. <!-- Enables the Spring MVC @Controller programming model -->
  16. <annotation-driven />
  17.  
  18. <!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources directory -->
  19. <resources mapping="/resources/**" location="/resources/" />
  20.  
  21. <!-- Resolves views selected for rendering by @Controllers to .jsp resources in the /WEB-INF/views directory -->
  22. <beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  23. <beans:property name="prefix" value="/views/" />
  24. <beans:property name="suffix" value=".jsp" />
  25. </beans:bean>
  26.  
  27. <context:component-scan base-package="com.nitin.SpringDemo.controller" />
  28.  
  29. <beans:bean id="datasource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  30. <beans:property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
  31. <beans:property name="url" value="jdbc:oracle:thin:@localhost:1521:ORCL" />
  32. <beans:property name="username" value="hr" />
  33. <beans:property name="password" value="hr" />
  34. </beans:bean>
  35.  
  36.  
  37.  
  38. <!-- Hibernate 4 SessionFactory Bean definition -->
  39. <beans:bean id="hibernate4AnnotatedSessionFactory"
  40. class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
  41. <beans:property name="dataSource" ref="dataSource" />
  42. <beans:property name="annotatedClasses">
  43. <beans:list>
  44. <beans:value>com.nitin.SpringDemo.controller</beans:value>
  45. </beans:list>
  46. </beans:property>
  47. <beans:property name="hibernateProperties">
  48. <beans:props>
  49. <beans:prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect
  50. </beans:prop>
  51. <beans:prop key="hibernate.show_sql">true</beans:prop>
  52. </beans:props>
  53. </beans:property>
  54. </beans:bean>
  55.  
  56. <beans:bean id="ServiceInterface" class="com.nitin.SpringDemo.controller.SpringDao">
  57. <beans:property name="sessionFactory" ref="hibernate4AnnotatedSessionFactory" />
  58. </beans:bean>
  59.  
  60. <context:component-scan base-package="com.nitin.SpringDemo.controller" />
  61.  
  62. <tx:annotation-driven transaction-manager="transactionManager"/>
  63.  
  64. <beans:bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
  65. <beans:property name="sessionFactory" ref="hibernate4AnnotatedSessionFactory" />
  66. </beans:bean>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement