<?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:p="http://www.springframework.org/schema/p"
	xmlns:mvc="http://www.springframework.org/schema/mvc"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
       http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd"
	default-lazy-init="true">
	<context:component-scan base-package="com.acbee.wms.controller"
		use-default-filters="false">
		<context:include-filter type="annotation"
			expression="org.springframework.stereotype.Controller" />
	</context:component-scan>
	<mvc:interceptors>
		<mvc:interceptor>
			<mvc:mapping path="/**" />
			<bean id="openSessionInViewInterceptor"
				class="org.springframework.orm.jpa.support.OpenEntityManagerInViewInterceptor">
				<property name="entityManagerFactory" ref="entityManagerFactory" />
			</bean>
		</mvc:interceptor>
	</mvc:interceptors>

	<bean id="multipartResolver"
		class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
		<property name="maxUploadSize">
			<value>10240000</value>
		</property>
		<property name="defaultEncoding" value="UTF-8" />
	</bean>
	<!-- 对模型视图名称的解析，即在模型视图名称添加前后缀 -->   
	<bean
		class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<property name="prefix" value="" />
		<property name="suffix" value="" />
	</bean>
	<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
		<property name="messageConverters">
			<list>
				<bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
					<property name="supportedMediaTypes">
						<list>
						<value>application/json;charset=UTF-8</value>
						<value>text/plain;charset=UTF-8</value>
						
						<value>text/html;charset=UTF-8</value>
						
						</list>
					</property>
				</bean>
				<bean class="org.springframework.http.converter.ByteArrayHttpMessageConverter" />
			</list>
		</property>
	</bean>
	<bean id="exceptionResolver" class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">    
         <property name="exceptionMappings">    
             <props>    
                 <prop key="java.lang.Exception">error</prop>    
                 <prop key="java.lang.Throwable">error</prop>    
             </props>    
         </property>    
         <property name="statusCodes">    
             <props>    
                 <prop key="error">500</prop>    
                 <prop key="error">404</prop>    
             </props>    
         </property>    
         <!-- 设置日志输出级别，不定义则默认不输出警告等错误日志信息 -->    
         <property name="warnLogCategory" value="WARN"></property>    
         <!-- 默认错误页面，当找不到上面mappings中指定的异常对应视图时，使用本默认配置 -->    
         <property name="defaultErrorView" value="error"></property>    
         <!-- 默认HTTP状态码 -->    
         <property name="defaultStatusCode" value="500"></property>    
     </bean>
     
	<!-- 注册XmlViewResolver，用于iReport & JasperReports报表生成 -->
	<bean id="jasperReportResolver" class="org.springframework.web.servlet.view.XmlViewResolver">
		<property name="order" value="0" />
		<property name="location" value="WEB-INF/jasper-views.xml"/>
	</bean>
</beans>