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. webpack-dev-server的执行逻辑

    1.运行npm i webpack-dev-server -D 把工具安装到项目的本地开发依赖 2.改工具用法跟webpack的用法完全一样:package.json中增加配置,直接用npm run ...

  2. Java——ping & telnet实现

    ping & telnet 实现类: import org.springframework.data.web.JsonPath; import java.io.IOException; imp ...

  3. 使用 Chrome DevTools 调试 JavaScript

    参考网址如下: http://www.css88.com/archives/8175 https://jingyan.baidu.com/article/67508eb423d2929ccb1ce45 ...

  4. spring AOP AspectJ 定义切面实现拦截

    总结记录一下AOP常用的应用场景及使用方式,如有错误,请留言. 1.  讲AOP之前,先来总结web项目的几种拦截方式    A:  过滤器 使用过滤器可以过滤URL请求,以及请求和响应的信息,但是过 ...

  5. 雷林鹏分享:jQuery EasyUI 数据网格 - 设置排序

    jQuery EasyUI 数据网格 - 设置排序 本实例演示如何通过点击列表头来排序数据网格(DataGrid). 数据网格(DataGrid)的所有列可以通过点击列表头来排序.您可以定义哪列可以排 ...

  6. nginx增加第三方模块

    增加第三方模块 ============================================================ 一.概述nginx文件非常小但是性能非常的高效,这方面完胜ap ...

  7. C#操作MySQL的类

    C#操作MySQL的类 public class MySqlService { private static log4net.ILog logger = log4net.LogManager.GetL ...

  8. Analysis servlet

    @WebServlet("/cdiservlet") public class NewServlet extends HttpServlet { private Message m ...

  9. oracle 夸服务器、数据库查询

      create public database link 连接名 connect to 需要连接数据库名 identified by  需要连接数据库密码 USING '(DESCRIPTION = ...

  10. 爬虫(七)图片懒加载技术、selenium和PhantomJS

    动态数据加载处理 一.图片懒加载 什么是图片懒加载? 案例分析:抓取站长素材http://sc.chinaz.com/中的图片数据 #!/usr/bin/env python # -*- coding ...