123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?xml version="1.0" encoding="UTF-8"?>
- <beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:p="http://www.springframework.org/schema/p"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/mvc
- http://www.springframework.org/schema/mvc/spring-mvc.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context.xsd
- http://www.springframework.org/schema/aop
- http://www.springframework.org/schema/aop/spring-aop-4.2.xsd">
- <!-- MVC转换 -->
- <mvc:annotation-driven />
- <mvc:default-servlet-handler />
- <!-- 自动扫描bean,把作了注解的Controller转换为bean 注意不能扫描全包,否则跟spring上下文冲突,会导致上下文工具类失效-->
- <context:component-scan base-package="com.lote.wms.task.controller" />
- <!-- CGLIB动态代理 -->
- <aop:aspectj-autoproxy proxy-target-class="true" />
- <!-- 模型视图名称添加前后缀 -->
- <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/WEB-INF/views/" p:suffix=".jsp" />
- <!-- 启动Spring MVC的注解功能,完成请求和注解POJO的映射 -->
- <!-- <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />-->
- <!-- 文件上传 -->
- <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver" p:defaultEncoding="utf-8" />
- <!-- 字符串处理 -->
- <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter" p:ignoreDefaultModelOnRedirect="true">
- <property name="messageConverters">
- <list>
- <bean
- class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter" />
- </list>
- </property>
- </bean>
- <!-- spring mvc 4.0+的跨域配置 -->
- <mvc:cors>
- <mvc:mapping path="/**" allowed-origins="*" allow-credentials="true" max-age="1800" allowed-methods="GET,POST,OPTIONS"/>
- </mvc:cors>
- </beans>
|