<?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:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
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">
<!--对指定包及其子包进行扫瞄 ,并查找出能够自动注册为spring Bean的类 :
包括@Controller,@Service,@Component,@Repository注解标注的类-->
<context:component-scan base-package=" com.study.studymvc"/>
<!-- 启用spring mvc提供的注解驱动特性 -->
<mvc:annotation-driven />
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value=" /WEB-INF/pages/" />
<property name="suffix" value=".jsp" /><!--映射到"/WEB-INF/pages/"下以".jsp"结尾的文件 -->
</bean>
<import resource="classpath:spring-mybatis.xml" />
</beans>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
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">
<!--对指定包及其子包进行扫瞄 ,并查找出能够自动注册为spring Bean的类 :
包括@Controller,@Service,@Component,@Repository注解标注的类-->
<context:component-scan base-package=" com.study.studymvc"/>
<!-- 启用spring mvc提供的注解驱动特性 -->
<mvc:annotation-driven />
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value=" /WEB-INF/pages/" />
<property name="suffix" value=".jsp" /><!--映射到"/WEB-INF/pages/"下以".jsp"结尾的文件 -->
</bean>
<import resource="classpath:spring-mybatis.xml" />
</beans>