springmvc-config.xml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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:mvc="http://www.springframework.org/schema/mvc"
  5. xmlns:context="http://www.springframework.org/schema/context"
  6. xsi:schemaLocation="
  7. http://www.springframework.org/schema/beans
  8. http://www.springframework.org/schema/beans/spring-beans.xsd
  9. http://www.springframework.org/schema/context
  10. http://www.springframework.org/schema/context/spring-context.xsd
  11. http://www.springframework.org/schema/mvc
  12. http://www.springframework.org/schema/mvc/spring-mvc.xsd">
  13. <context:property-placeholder location="classpath:db.properties"/>
  14. <context:component-scan base-package="group04"/>
  15. <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" destroy-method="close">
  16. <property name="driverClassName" value="${jdbc.driver}"/>
  17. <property name="url" value="${jdbc.url}"/>
  18. <property name="username" value="${jdbc.username}"/>
  19. <property name="password" value="${jdbc.password}"/>
  20. </bean>
  21. <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
  22. <property name="dataSource" ref="dataSource" />
  23. <property name="configLocation" value="classpath:MyBatis-config.xml"/>
  24. </bean>
  25. <!--MyBatis Mapper FactoryBean-->
  26. <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
  27. <property name="basePackage" value="group04.myBatis"/>
  28. </bean>
  29. <!--Spring MVC.....(for primary web service)-->
  30. <!-- <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  31. <property name="prefix" value = "/"/>
  32. <property name="suffix" value = ".jsp"/>
  33. </bean> -->
  34. <!-- should add multipartResolver to use -->
  35. <!-- <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
  36. <property name="defaultEncoding" value="utf-8"/>
  37. <property name="maxUploadSize" value="2097152"/>
  38. </bean> -->
  39. <!-- <mvc:annotation-driven/>
  40. <mvc:default-servlet-handler/> -->
  41. <!-- <mvc:interceptors>-->
  42. <!-- <mvc:interceptor>-->
  43. <!-- <mvc:mapping path="/*"/>-->
  44. <!-- <mvc:exclude-mapping path="/LoginPage"/>-->
  45. <!-- <bean id="InterceptorLogin" class="MVCTry.InterceptorLogin"/>-->
  46. <!-- </mvc:interceptor>-->
  47. <!-- </mvc:interceptors>-->
  48. </beans>