<?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:mvc="http://www.springframework.org/schema/mvc"
	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"
	default-lazy-init="false">

	<!-- @Controller注解的使用前提配置 -->
	<mvc:annotation-driven />
	<!-- 扫描指定包 -->
	<context:component-scan base-package="com.ifish.action,com.ifish.exception" />
	<!-- 默认的Servlet来响应静态文件 -->
	<!-- <mvc:default-servlet-handler /> -->
	
	<!-- 导入外部的properties文件-->
	<context:property-placeholder location="classpath*:ifish.properties" ignore-unresolvable="true"/>
	
	<!-- 拦截器 -->
	<mvc:interceptors>
		<!-- 使用bean定义一个Interceptor，直接定义在mvc:interceptors根下面的Interceptor将拦截所有的请求 -->
		<!-- <bean class="com.ifish.interceptor.SecurityValidateInterceptor" /> -->
		<mvc:interceptor>
			<!-- 定义在mvc:interceptor下面的表示是对特定的请求才进行拦截的 -->
			<mvc:mapping path="/**"/>
			<mvc:exclude-mapping path="/user/**"/>
			<mvc:exclude-mapping path="/updateUser/**"/>
			<mvc:exclude-mapping path="/pageList/**"/>
			<mvc:exclude-mapping path="/information/v3/findCommentsByUeditorId.do"/>
			<mvc:exclude-mapping path="/information/v3/saveComment.do"/>
			<bean class="com.ifish.interceptor.SecurityValidateInterceptor" >
				<constructor-arg name="devModel" value="${devModel}"/>
			</bean>
		</mvc:interceptor>
	</mvc:interceptors>
	
	<!-- url映射
	<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
		<property name="urlMap">
			<map>
				<entry key="/users/*.do" value-ref="usersAction" />
				<entry key="/user/*.do" value-ref="userAction" />
				<entry key="/updateUser/*.do" value-ref="updateUserAction" />
				<entry key="/pageList/*.do" value-ref="pageListAction" />
				<entry key="/liveRoom/*.do" value-ref="liveRoomAction" />
				<entry key="/information/*.do" value-ref="informationAction" />
				<entry key="/shops/*.do" value-ref="shopsAction" />
				<entry key="/ifishDoctor/*.do" value-ref="ifishDoctorAction" />
			</map>
		</property>
	</bean>
	视图配置
	<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<property name="prefix" value="/WEB-INF/view/"></property>
		<property name="suffix" value=".jsp"></property>
	</bean>
	
	配置返回Json数据，方法用ResponseBody注解
	<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter">
		<property name="messageConverters">
			<list>
				<bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"/>
			</list>
		</property>
	</bean> -->

</beans>