<?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"
    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/context
        http://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc.xsd
        http://www.springframework.org/schema/aop
        http://www.springframework.org/schema/aop/spring-aop.xsd">

    <!-- 注解  <context:component-scan> -->
    <!-- 启动扫描器  扫描base-package="" 这个包里面的bean
    就可以省略 <bean id="" class="" /> 这个写法
    同时bean 需要注解
     注解的类型有 controller 、service 、repository 、component
-->
    <context:component-scan base-package="com"/>

<!--handlerMapping 就是处理器映射,可以将web请求映射到正确的处理器-->
<bean  id= "halderMapping" class="" >
 <property name="mappings">
  <props>
    <prop name="/login.do">login</prop>
  <props>
</property>
</bean>
<!--对应上面的 login.do 的value值-->
<bean id="login" class="">

<!--mvc扫描,有了它就可以不用写上面的处理器映射
 同时 controller组件的方法上面要加上 注解
@RequestMapping("/login.do")  处理login.do请求路径的方法
@RequestParam("username") 指定传入的web里面 name="username"参数
 -->
    <mvc:annotation-driven></mvc:annotation-driven>

    <!-- 定义视图解析器 -->
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<!--  前缀和后缀
<property name="prefix" value="/WEB-INF"></property>

<property name="suffix" value=".jsp"></property> 
-->

</bean>


</beans>

SpringMVC的配置文件说明的更多相关文章

  1. 关于springmvc的配置文件

    开发常用的springmvc.xml配置文件,spring 3.0 spring-servlet.xml配置. <?xml version="1.0" encoding=&q ...

  2. 3.SpringMVC修改配置文件路径和给界面传递数据

    1.修改配置文件路径  达到  配置多文件的目的 web.xml文件中基础配置有springMVC配置的servlet路径 <servlet-name>SpringMVC</serv ...

  3. SpringMVC深度探险(四) —— SpringMVC核心配置文件详解

    在上一篇文章中,我们从DispatcherServlet谈起,最终为读者详细分析了SpringMVC的初始化主线的全部过程.整个初始化主线的研究,其实始终围绕着DispatcherServlet.We ...

  4. ssm框架 spring的主配置文件 spring-mvc主配置文件 web.xml配置文件(基础的配置文件)

    1.spring主配置文件 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns=" ...

  5. (转)SpringMVC学习(三)——SpringMVC的配置文件

    http://blog.csdn.net/yerenyuan_pku/article/details/72231527 读者阅读过SpringMVC学习(一)——SpringMVC介绍与入门这篇文章后 ...

  6. Spring+SpringMVC整合----配置文件

    1.在 web.xml 中加载 spring 的配置文件 bean.xml    底层是 Listener <!-- Spring --> <context-param> &l ...

  7. 加载自定义目录下的springmvc.xml配置文件

    在默认情况下:springmvc框架的配置文件必须叫<servlet-name>-servlet.xml 且必须放在/WEB-INF/目录下,我们可以在web.xml文件中,为Dispat ...

  8. springMVC项目配置文件

    一.springMVC项目配置文件 1.web.xml文件全局配置 <servlet> <servlet-name> dispatcher </servlet-name& ...

  9. spring-mvc.xml配置文件出错

    在整合ssm三大框架的时候,配置spring-mvc.xml的文件的 <mvc:default-servlet-handler/> <mvc:annotation-driven /& ...

  10. Spring+SpringMVC重复加载配置文件问题

    sping+springmvc的框架中,IOC容器的加载过程 http://my.oschina.net/xianggao/blog/596476 基本上是先加载ContextLoaderListen ...

随机推荐

  1. Spring组件扫描--源码跟踪

    看这篇文章之前可以先了解之前的跟踪流程,https://www.jianshu.com/p/4934233f0ead 代码过宽,可以shift + 鼠标滚轮 左右滑动查看 这篇文章主要跟踪spring ...

  2. Day4 - K - Ant Trip HDU - 3018

    Ant Country consist of N towns.There are M roads connecting the towns. Ant Tony,together with his fr ...

  3. 019、MySQL取本季度开始时间和本季度结束时间

    SELECT QUARTER ( adddate( dy, ) ) QTR, date_add( dy, INTERVAL MONTH ) Q_start, adddate( dy, ) Q_end ...

  4. 【转】转帖并注释:Java中的事件处理机制--事件监听器的四种实现方式

    原文地址:http://blog.sina.com.cn/s/blog_4b650d650100nqws.html Java中四种事件监听器的实现方式分别为: 自身类做为事件监听器 外部类作为事件监听 ...

  5. python SSTI绕过

    原理首先以jinja2模板注入为例:{{request[request.args.param]}} 可以用 {{request|attr(request.args.param)}} 替代绕过" ...

  6. 机器学习-liuyubobobo(慕课网)

    第一章 python3玩转机器学习 第二章 机器学习基础 安装:1.anaconda   2.pycharm 第三章 Jupyter Notebook,numpy,Matplotlib 1.jupyt ...

  7. JSONObject 和JSONArray基本使用

    1. 打包 JSONObject jsonObject = new JSONObject(); jsonObject.put("code", "200"); j ...

  8. Tips for traing DNN

    1.   一般的机器学习方法不会在train好的模型上检查training data的结果,因为DNN在training data上都没有办法获得很好的正确率, 所以要先回头看一下要对模型做什么修改, ...

  9. Linux镜像源 国内列表

    (一).企业站 1.搜狐:http://mirrors.sohu.com/ 2.网易:http://mirrors.163.com/ 3.阿里云:http://mirrors.aliyun.com/ ...

  10. mybaits-plus总结

    import java.math.BigDecimal; import java.util.Arrays; import java.util.Date; import java.util.List; ...