Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.25 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:context="http://www.springframework.org/schema/context"
  4. xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx"
  5. xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
  6. http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  7. http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
  8. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
  9.  
  10. <context:component-scan base-package="in.net.usit"/>
  11. <tx:annotation-driven transaction-manager="transactionManager"/>
  12. <mvc:annotation-driven></mvc:annotation-driven>
  13.  
  14. <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  15. <property name="prefix" value="/WEB-INF/view/"></property>
  16. <property name="suffix" value=".jsp"></property>
  17. </bean>
  18. <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  19. <property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
  20. <property name="url" value="jdbc:mysql://localhost:3306/lts2d/lts2dnew"></property>
  21. <property name="username" value="root"/>
  22. <property name="password" value="root"/>
  23. </bean>
  24.  
  25. <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
  26. <property name="packagesToScan" value="in.net.usit.beans"></property>
  27. <property name="dataSource" ref="dataSource"></property>
  28. <property name="hibernateProperties">
  29. <props>
  30. <prop key="hibernate.dialect" >org.hibernate.dialect.MySQLDialect</prop>
  31. <prop key="hibernate.show_sql"> true</prop>
  32. <prop key="hibernate.hb2ddl.auto">update</prop>
  33. <prop key="hibernate.connection.pool_size">1</prop>
  34. </props>
  35. </property>
  36. </bean>
  37. <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
  38. <property name="sessionFactory" ref="sessionFactory"></property>
  39. </bean>
  40. <mvc:resources mapping="/resources/**" location="/resources/img/"/>
  41. <!-- <mvc:default-servlet-handler /> -->
  42.  
  43. package in.net.usit.controller;
  44.  
  45. import org.springframework.stereotype.Controller;
  46. import org.springframework.web.bind.annotation.RequestMapping;
  47. import org.springframework.web.bind.annotation.RequestMethod;
  48.  
  49. import in.net.usit.service.LadleLocationServiceImpl;
  50.  
  51. @Controller
  52. public class IndexController {
  53.  
  54. private LadleLocationServiceImpl ladleLocationService;
  55.  
  56. @RequestMapping(value="/main",method=RequestMethod.GET)
  57. public String getIndexPage(){
  58. System.out.println("Inside the controller ");
  59. return "index";
  60. }
  61.  
  62. }
  63.  
  64. <servlet>
  65. <servlet-name>spring</servlet-name>
  66. <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  67. </servlet>
  68.  
  69. <servlet-mapping>
  70. <servlet-name>spring</servlet-name>
  71. <url-pattern>/</url-pattern>
  72. </servlet-mapping>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement