Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
- xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx"
- xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.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-3.1.xsd">
- <context:component-scan base-package="in.net.usit"/>
- <tx:annotation-driven transaction-manager="transactionManager"/>
- <mvc:annotation-driven></mvc:annotation-driven>
- <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
- <property name="prefix" value="/WEB-INF/view/"></property>
- <property name="suffix" value=".jsp"></property>
- </bean>
- <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
- <property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
- <property name="url" value="jdbc:mysql://localhost:3306/lts2d/lts2dnew"></property>
- <property name="username" value="root"/>
- <property name="password" value="root"/>
- </bean>
- <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
- <property name="packagesToScan" value="in.net.usit.beans"></property>
- <property name="dataSource" ref="dataSource"></property>
- <property name="hibernateProperties">
- <props>
- <prop key="hibernate.dialect" >org.hibernate.dialect.MySQLDialect</prop>
- <prop key="hibernate.show_sql"> true</prop>
- <prop key="hibernate.hb2ddl.auto">update</prop>
- <prop key="hibernate.connection.pool_size">1</prop>
- </props>
- </property>
- </bean>
- <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
- <property name="sessionFactory" ref="sessionFactory"></property>
- </bean>
- <mvc:resources mapping="/resources/**" location="/resources/img/"/>
- <!-- <mvc:default-servlet-handler /> -->
- package in.net.usit.controller;
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import in.net.usit.service.LadleLocationServiceImpl;
- @Controller
- public class IndexController {
- private LadleLocationServiceImpl ladleLocationService;
- @RequestMapping(value="/main",method=RequestMethod.GET)
- public String getIndexPage(){
- System.out.println("Inside the controller ");
- return "index";
- }
- }
- <servlet>
- <servlet-name>spring</servlet-name>
- <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
- </servlet>
- <servlet-mapping>
- <servlet-name>spring</servlet-name>
- <url-pattern>/</url-pattern>
- </servlet-mapping>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement