Guest User

Untitled

a guest
Jan 21st, 2018
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.47 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"
  4. xmlns:context="http://www.springframework.org/schema/context"
  5. xmlns:tx="http://www.springframework.org/schema/tx"
  6. xmlns:mvc="http://www.springframework.org/schema/mvc"
  7. xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd
  8. http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
  9. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
  10. http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.2.xsd">
  11. <context:component-scan base-package="com.accenture"></context:component-scan>
  12. <context:annotation-config></context:annotation-config>
  13. <mvc:annotation-driven></mvc:annotation-driven>
  14. <tx:annotation-driven/>
  15.  
  16. <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  17.  
  18. <property name="prefix" value="/jsps/"></property>
  19. <property name="suffix" value=".jsp"></property>
  20.  
  21.  
  22.  
  23. </bean>
  24.  
  25.  
  26. <bean id="ds" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  27. <property name="username" value="root"></property>
  28. <property name="password" value="root"></property>
  29. <property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
  30. <property name="url" value="jdbc:mysql://localhost:3306/login"></property>
  31. </bean>
  32. <bean id="template" class="org.springframework.jdbc.core.JdbcTemplate">
  33. <property name="dataSource" ref="ds"></property>
  34.  
  35.  
  36. </bean>
  37.  
  38. <!-- <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
  39. <property name="basename" value="validation.properties"></property>
  40.  
  41. </bean> -->
  42. <!-- <bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
  43. <property name="defaultLocale" value="en_US"></property>
  44. </bean> -->
  45.  
  46.  
  47.  
  48. <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
  49.  
  50. <property name="dataSource" ref="ds"></property>
  51. <property name="configLocation" value="classpath:hibernate.cfg.xml"></property>
  52.  
  53. </bean>
  54.  
  55. <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager" primary="true">
  56. <property name="sessionFactory" ref="sessionFactory"></property>
  57. </bean>
  58.  
  59.  
  60.  
  61. <bean id="transactionManager1" class="org.springframework.jdbc.datasource.DataSourceTransactionManager" primary="false">
  62. <property name="dataSource" ref="ds"></property>
  63. </bean>
  64.  
  65.  
  66.  
  67.  
  68. </beans>
  69.  
  70.  
  71.  
  72. =========================================================================================xml==============
  73. <?xml version="1.0" encoding="UTF-8"?>
  74. <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
  75. <display-name>Login</display-name>
  76. <servlet>
  77. <servlet-name>accent</servlet-name>
  78. <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  79. <load-on-startup>1</load-on-startup>
  80. </servlet>
  81.  
  82. <!-- Map all requests to the DispatcherServlet for handling -->
  83. <servlet-mapping>
  84. <servlet-name>accent</servlet-name>
  85. <url-pattern>*.htm</url-pattern>
  86. </servlet-mapping>
  87. </web-app>
Add Comment
Please, Sign In to add comment