配置Spring MVC - 2019
未完
软件环境:Eclipse-EE
1. 创建Maven Project
2. pom.xml - [更新日期19/03/31]
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>5.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
如果deploy失败,就搜个新的版本
3. web.xml
<web-app>
<display-name>Archetype Created Web Application</display-name> <servlet>
<servlet-name>DemoDispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet> <servlet-mapping>
<servlet-name>DemoDispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping> </web-app>
4. {something}-servlet.xml
<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:tx="http://www.springframework.org/schema/tx" xmlns:mvc="http://www.springframework.org/schema/mvc"
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/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd"> <!-- 配置扫描的包 -->
<context:annotation-config />
<context:component-scan base-package="com.cres.*" /> </beans>
配置Spring MVC - 2019的更多相关文章
- 如何用Java类配置Spring MVC(不通过web.xml和XML方式)
DispatcherServlet是Spring MVC的核心,按照传统方式, 需要把它配置到web.xml中. 我个人比较不喜欢XML配置方式, XML看起来太累, 冗长繁琐. 还好借助于Servl ...
- Spring 4 官方文档学习(十一)Web MVC 框架之配置Spring MVC
内容列表: 启用MVC Java config 或 MVC XML namespace 修改已提供的配置 类型转换和格式化 校验 拦截器 内容协商 View Controllers View Reso ...
- Java方式配置Spring MVC
概述 使用Java方式配置Spring MVC,以及回顾一下Spring MVC的各种用法. Spring MVC简述 关于Spring MVC的介绍网上有很多,这里就不再赘述了,只是要说一下,Spr ...
- 如何在Web项目中配置Spring MVC
要使用Spring MVC需要在Web项目配置文件中web.xml中配置Spring MVC的前端控制器DispatchServlet <servlet> <servlet-name ...
- Spring MVC - 配置Spring MVC
写在前面的话: 现在开始一段新的学习历程:Spring MVC.还是按照原来的三步走学习模式(what.why.how)进行讲解. 1.Spring MVC是什么(what) Spring MVC属于 ...
- 通过eclipse配置Spring MVC项目
上一篇刚建立了一个简单的Spring项目,其实Spring MVC是一个和Struts2一样的基于MVC设计模式的web框架,并且继承了MVC的优点,是基于请求驱动的轻量级的web框架,spring ...
- maven配置spring mvc+hibernate+spring框架
作为一名刚出茅草屋的新手小白写的框架,仅适合新手小白借鉴,大神勿喷,谢谢...... 前天刚知道spring mvc这个框架现在也很流行,决定用它代替struts2来写我的毕业设计. ...作为一名新 ...
- Spring MVC 零配置 / Spring MVC JavaConfig
1. Spring MVC的核心就是DispatcherServlet类,Spring MVC处理请求的流程如下图所示: 2. Spring MVC中典型的上下文层次 当我们初始化一个Dispatch ...
- 0077 web.xml中配置Spring MVC时,Servlet-name上报Servlet should have a mapping的错误
这次是手工建立的web工程目录,在配置webapp/WEB-INF/web.xml的Spring MVC的DispatcherServlet时,在servlet-name上报错:Servlet sho ...
随机推荐
- MAC 终端走代理服务器
问题描述: MAC 终端,默认不走代理服务器:即浏览器已经可以FQ,但是终端不行: 解决方案:直接设置终端的代理,本文 用的是 shadowSocksX: 打开终端,直接执行:(执行后,只对当前终端起 ...
- 阿里负载均衡,配置中间证书问题(在starcom申请免费DV ssl)
前提假如免费版相关证书都已经配置到位,但是微信小程序Android访问有问题,检测域名(https://www.myssl.cn/tools/check-server-cert.html)发现服务器缺 ...
- 【函数参数】什么是*args和**kwargs?
**args表示任何多个无名参数,它是一个tuple,Python将**args从开始到结束作为一个tuple传入函数 **kwargs表示关键字参数,它是一个dict,Python将**kwargs ...
- 递归算法+sql三种分页
using Maticsoft.Common; using System; using System.Collections.Generic; using System.Data; using Sys ...
- Why ngx-uploader doesn't like to cooperate with .net core 2.x?
The POST action seems to have no effect on the .net core controller. If you put [IgnoreAntiforgeryTo ...
- 【Spark-SQL学习之三】 UDF、UDAF、开窗函数
环境 虚拟机:VMware 10 Linux版本:CentOS-6.5-x86_64 客户端:Xshell4 FTP:Xftp4 jdk1.8 scala-2.10.4(依赖jdk1.8) spark ...
- 原生JS实现表单序列化serialize()
有一个form表单,要用AJAX后台提交,原来想拼接json,但是数据多了麻烦,不灵活. 用HTML5的FormData来初始化表单 var formdata=new FormData(documen ...
- 数据库表中不建索引,在插入数据时,通过sql语句防止重复添加
sql 语句 INSERT IGNORE INTO table(aaa,bbb) SELECT '1111','2222' FROM DUAL WHERE NOT EXISTS( ' ) mybati ...
- vxworks开发中simulator的使用之建立虚拟网卡
在使用windriver workben ch开发vxWorks应用时,有时需要在本机上利用Simulator跑一下程序,这就需要你安装一个虚拟的网卡.vxWorks自带了这些工具,下面,以windo ...
- 虚拟蜜罐honeyd安装使用
转https://blog.csdn.net/jack237/article/details/6828771