<?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:p="http://www.springframework.org/schema/p"
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-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<!-- 要引入mvc标签 -->
<!-- 这个叫前端控制器,我们要通过名字找到真正的控制器controler -->
<!--方法1: 使用注解的方式访问 (DefaultAnnotationHandlerMapping)-->
<!-- 启动注解:配置注解驱动的自动扫描器 -->
<mvc:annotation-driven/>
<!-- 到指定包扫描我的注解 -->
<context:component-scan base-package="net.jbit.controller"/>
<!-- ===================================================== -->
<!-- 视图解析器(配置返回真正的结果) -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<!-- 前缀 -->
<property name="prefix" value="/WEB-INF/jsp/"/>
<!-- 后缀 -->
<property name="suffix" value=".jsp"/>
</bean>
<!-- ===================================================== -->
<!--方法2: 根据bean的名字去访问(不常用) -->
<!-- <bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/>
<bean name="/apple.html" class="net.jbit.controller.HelloController"/> -->
</beans>
<!-- ============================================================= -->
<!-- 单词 -->
<!-- internal[ɪn'tɜːn(ə)l]内部的;内在的;国内的 -->
<!-- resolver[riː'zɒlvə]溶剂;[电子] 分解器;下决心者 -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
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-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<!-- 要引入mvc标签 -->
<!-- 这个叫前端控制器,我们要通过名字找到真正的控制器controler -->
<!--方法1: 使用注解的方式访问 (DefaultAnnotationHandlerMapping)-->
<!-- 启动注解:配置注解驱动的自动扫描器 -->
<mvc:annotation-driven/>
<!-- 到指定包扫描我的注解 -->
<context:component-scan base-package="net.jbit.controller"/>
<!-- ===================================================== -->
<!-- 视图解析器(配置返回真正的结果) -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<!-- 前缀 -->
<property name="prefix" value="/WEB-INF/jsp/"/>
<!-- 后缀 -->
<property name="suffix" value=".jsp"/>
</bean>
<!-- ===================================================== -->
<!--方法2: 根据bean的名字去访问(不常用) -->
<!-- <bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/>
<bean name="/apple.html" class="net.jbit.controller.HelloController"/> -->
</beans>
<!-- ============================================================= -->
<!-- 单词 -->
<!-- internal[ɪn'tɜːn(ə)l]内部的;内在的;国内的 -->
<!-- resolver[riː'zɒlvə]溶剂;[电子] 分解器;下决心者 -->