Spring Web MVC是一种基于Java的实现了Web MVC设计模式的请求驱动类型的轻量级Web框架,即使用了MVC架构模式的思想,将web层进行职责解耦,基于请求驱动指的就是使用请求-响应模型,框架的目的就是帮助我们简化开发,Spring Web MVC也是要简化我们日常Web开发的。

<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"
    xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-3.2.xsd
        http://www.springframework.org/schema/aop
        http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
        http://www.springframework.org/schema/tx
        http://www.springframework.org/schema/tx/spring-tx-3.2.xsd ">
        <!-- 配置Controller -->
<bean id="UsersController" name="/user.action" class="cn.neusoft.controller.UsersController"></bean>

<!-- 配置映射器 -->
        <bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"></bean>
    
    <!--项目中使用扫描包的方式进行  -->
    <context:component-scan base-package="cn.neusoft.controller"></context:component-scan>

<!-- 配置处理器适配器 -->
    <bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter"></bean>
    <!-- 另一个适配器 -->
<bean class="org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter"></bean>
<!-- 配置视图解析器 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<!-- 配置jsp 页面前缀 -->
<property name="prefix" value="/WEB-INF/jsp"></property>
<!-- 配置jsp 页面后缀 -->
<property name="suffix" value=".jsp"></property>
</bean>
</beans>

sprindmvc的更多相关文章

随机推荐

  1. SpringBoot项目打成一个war包

    springboot 带有内置Tomcat 服务器,可以直接将项目打包成jar运行,运行命令为: java -jar demo.jar 但是如果在需要把项目达成war包该怎么办呢?下面是将spring ...

  2. 在linux 上安装ansible

    ansible 在线安装:yum install -y epel-releaseyum install -y ansible离线安装:rpm wget https://releases.ansible ...

  3. Redis缓存之自定义CacheManager

    测试缓存:原理:CacheManager===Cache 缓存组件来实际给缓存中存储数据1,引入redis的starter,容器中保存的是RedisCacheManager2,RedisCacheMa ...

  4. docker 中安装 redis

    使用以下命令在Docker Hub搜索Redis镜像docker search redis 使用以下命令拉取镜像,Redis的镜像docker pull redis:latest 使用以下命令查看,本 ...

  5. 8.2 GOF设计模式一: 单实例模式 SingleTon

    GOF设计模式一: 单实例模式 SingleTon  整个美国,只有一个“现任美国总统”  比如,在学校,“老师”,有数百个:“校长”,只有一个  系统运行时,如何保证某个类只允许实例化一个对象 ...

  6. Android studio和Genymotion-VirtualBox的配合使用

    Android Studio自带的模拟器实在是太慢了,对于我这种急性子来说简直...好了,我不想说脏话 那么我们就愉快的使用Genymotion好了 Android 开发最好的网站:http://ww ...

  7. this的四种用法

    函数运行时,自动生成的一个内部对象,只能在函数内部使用 随着函数使用场合的不同,this的值也发生着改变,但是有一个总原则:this指的是调用函数的那个对象(核心) 1.纯粹的函数调用 this指的是 ...

  8. C语言实现过滤ASCII在0~127范围内的字符,并去除重复的字符

    #include <stdio.h> #include <string.h> /* 1.以字符串作为参数 2.找出ASCII在1~127范围内的字符 3.去掉重复字符 */ i ...

  9. 常用js函数开始收集~

    获取样式: var getStyle=function(ele,atr){ return typeof(ele)=='undefined'?0: ele.currentStyle? ele.curre ...

  10. 迁移 Emacs 的自定义设置

    在一台电脑上设置好了 Emacs 自定义的许多包和参数,想要便捷地把各项设置迁移到另一台目标电脑,其实是很简便的. 一般情况下,各个package位于 ~/.emacs.d/ 文件夹内,我们需要做的只 ...