679fa33228bc111f186d69bb38135c799e58cb3d.svn-base 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xmlns:context="http://www.springframework.org/schema/context"
  4. xmlns:mvc="http://www.springframework.org/schema/mvc"
  5. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
  6. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
  7. http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd">
  8. <!-- 自动扫描且只扫描@Controller -->
  9. <context:component-scan base-package="com.yihu.jkedu.action" use-default-filters="false">
  10. <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" />
  11. </context:component-scan>
  12. <!-- 自动扫描且只扫描@Service -->
  13. <context:component-scan base-package="com.yihu.jkedu.service" ></context:component-scan>
  14. <mvc:annotation-driven />
  15. <mvc:default-servlet-handler />
  16. <!-- 定义首页 -->
  17. <mvc:view-controller path="/" view-name="/main/login" />
  18. <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  19. <property name="prefix" value="/" />
  20. <property name="suffix" value=".jsp" />
  21. </bean>
  22. <!-- 支持上传文件 -->
  23. <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver" />
  24. </beans>