You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mvc-dispatcher-servlet.xml 1.6 kB

2 years ago
12345678910111213141516171819202122232425262728293031323334
  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:mvc="http://www.springframework.org/schema/mvc"
  6. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
  7. <!--指明 controller 所在包,并扫描其中的注解-->
  8. <context:component-scan base-package="com.educoder.bridge.controller"/>
  9. <!-- 静态资源(js、image等)的访问 -->
  10. <mvc:default-servlet-handler/>
  11. <!--ViewResolver 视图解析器-->
  12. <!--用于支持freemarker视图解析-->
  13. <!--视图解释器 -->
  14. <bean id="viewResolver"
  15. class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
  16. <property name="suffix">
  17. <value>.ftl</value>
  18. </property>
  19. <property name="contentType" value="text/html;charset=UTF-8"></property>
  20. </bean>
  21. <!-- 开启注解 -->
  22. <mvc:annotation-driven/>
  23. <bean class="springfox.documentation.swagger2.configuration.Swagger2DocumentationConfiguration" id="swagger2Config"/>
  24. <mvc:resources location="classpath:/META-INF/resources/" mapping="swagger-ui.html"/>
  25. <mvc:resources location="classpath:/META-INF/resources/webjars/" mapping="/webjars/**"/>
  26. </beans>