<?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. Linux基础命令、软件安装

    常用命令 查看当前系统中存在哪些shell cat /etc/shells [root@** ~]# cat /etc/shells /bin/sh /bin/bash /usr/bin/sh /us ...

  2. eshop7-mysql

    1. Mysql 安装 执行 yum -y install mysql-server 注意:(1)是否使用sudo 权限执行请根据您具体环境来决定 (2)检查是否已经安装mysql-server rp ...

  3. C++用sqlite3_open连接打开指定数据库的小问题

    一开始我也纳闷,我以为是我数据库没弄好,但是当我仔细检查,才发现 原来我少了分号 写少了分号,可能会导致  database    和  table    找不到... 所以用的时候需要注意... 代 ...

  4. Essay写作:Conclusion部分写作辅导

    论文写到最后,一般正文就要以Conclusion结束了.Conclusion部分是一篇论文的正文结尾(the last section of a paper,last paragraph),主要是客观 ...

  5. 自定义对象使用 ArrayList 进行增删改查(dos程序)

    马上要进行java基础考试了,闲着写一次博客,把这10周学的东西过一遍,可能没过全,.....但是我觉得增删改查是必须的,以前一直不会用ArrayList  自定义对象....... 案例如下:自己根 ...

  6. plsql调用执行存储过程

    参考 https://www.cnblogs.com/enjoyjava/p/9131169.html ------------------------------------------------ ...

  7. OpenJudge - NOI - 1.1编程基础之输入输出(C语言 全部题解)

    01:Hello, World! #include <stdio.h> int main(void) { printf("Hello, World!"); return ...

  8. 五十六、SAP中LVC表格的常用布局属性LVC_S_LAYO

    一.LVC_S_LAYO为表格常用的布局属性,包括网格线,宽度自适应,隐藏主键等 二.我们来对比使用前和使用后的表格,这个原始布局风格的表格 三.这个是设置了相关属性的表格

  9. 002、将mysql用作一个简单的计算器

    SELECT PI( ), , ( ) ; 不忘初心,如果您认为这篇文章有价值,认同作者的付出,可以微信二维码打赏任意金额给作者(微信号:382477247)哦,谢谢.

  10. 145-PHP 使用<<<和HTML混编(一)

    <?php $html=<<<TEMP1 <title>PHP输出HTML代码</title> <body> <a href=#> ...