当你的SSM项目中的springmvc.xml发生第一行错误解决方案
当你新建了一个SSM项目,你复制网上的xml文件来配置或者你下载了一个SSM项目打开发现xml文件错误,打开是第一行报错的时候你是不是很懵逼

或者是这样

总之就是xml文件中<?xml version="1.0" encoding="UTF-8"?>报错该怎么办呢。解决方法
核对清楚你要的xmlns先,然后去网上找其他的springMVC.xml的配置,然后复制到你的文件上保存,看还报错不,如果发生了标头以下内容报错了,那说明你少了那个标头声明,你所以你要核对清楚你要的声明。
比如

则发生

所以如果你复制了网上的表头声明发生原本没错的内容错误,则考虑你需要的一下表头声明缺失了。
下面提供一些我的可以正确使用的xml标头声明
比如适用于applicationContext.xml的表头声明
<?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:tx="http://www.springframework.org/schema/tx" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/jdbc
http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
适用于springmvc.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:mvc="http://www.springframework.org/schema/mvc"
xmlns:task="http://www.springframework.org/schema/task"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-3.1.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
">
以上
希望能帮到
当你的SSM项目中的springmvc.xml发生第一行错误解决方案的更多相关文章
- 一文懂SSM项目中的web.xml常用配置项
做web后端工程师,逃不过的web.xml,我们都知道配置这个文件是日常工作了,那么我们来把一些必须知道知识点梳理下. 我们把web项目启动的时候,首先加载的就是web.xml这个文件,只有这个文件所 ...
- ssm项目中遇到微信用户名称带有表情,插入失败问题
ssm项目中遇到微信用户名称带有表情,插入失败问题 问题 Mysql的utf8编码最多3个字节,而Emoji表情或者某些特殊字符是4个字节. 因此会导致带有表情的昵称插入数据库时出错. 解决方法 一. ...
- ssm项目中中文字符乱码
昨天给同学改一个错,在SSM项目中,表单输入的String类型中,中文字符值,总是乱码,在控制器层获取的数据就开始乱码,先后进行了如下排查: web.xml中配置设置字符编码的监听器(过滤器), js ...
- SSM搭配中的web.xml的配置信息
最近一段时间在自己学着搭建SSM框架的项目,其实这个项目自由自己不断尝试,不断失败,才能印象更深刻. 下面就说一下在项目中的web.xml的相关配置信息: <?xml version=" ...
- 转 web项目中的web.xml元素解析
转 web项目中的web.xml元素解析 发表于1年前(2014-11-26 15:45) 阅读(497) | 评论(0) 16人收藏此文章, 我要收藏 赞0 上海源创会5月15日与你相约[玫瑰里 ...
- 举例android项目中的string.xml出现这个The character reference must end with the ';' delimiter.错误提示的原因及解决办法
今天在一个android项目中的string.xml中写这样一个字符串时出现了下面这个错误提示: The reference to entity "说明" must end wit ...
- 刚创建的maven项目,pom.xml的第一行就报错
刚创建的maven项目,马上pom.xml的第一行就报错这是第一行:<project xmlns="http://maven.apache.org/POM/4.0.0" xm ...
- Redis在SSM项目中的简单使用
一.基于SSM的Redis环境配置 前提是你的开发电脑安装和配置好了redis,如果没安装请看Window配置Redis环境和简单使用 1.1.pom文件中引入redis客户端jar包(pom.xml ...
- ssm项目中ueditor富文本编辑器的使用
一.下载 https://ueditor.baidu.com/website/index.html 将ueditor放到项目中合适的位置 二 . 配置文件上传路径 在utf8-jsp/jsp/conf ...
随机推荐
- pprint模块介绍
简介pprint模块 提供了打印出任何Python数据结构类和方法. 模块方法: 1.class pprint.PrettyPrinter(indent=1,width=80,depth=None, ...
- 一语惊醒梦中人-《Before I Fall》
I still remembered I turned my attention to the title when I browsed in news by cellphone.I saw the ...
- [2013-06-05]bat脚本设置DNS
有时候需要切换本机dns,将网络环境转至测试环境 @echo off netsh interface ip set dns name="本地连接" source=static ad ...
- clob字段的值插入和查询N种方法【包括java调用存储过程传入clob参数】
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import jav ...
- C#设计模式(4)-抽象工厂模式
引言 上一篇介绍了设计模式中的简单工厂模式-C#设计模式(3)-工厂方法模式,本篇将介绍抽象工厂模式: 抽象工厂模式简介 抽象工厂模式(AbstractFactory):提供一个创建一系列相关或相互依 ...
- HDU 6184 Counting Stars 经典三元环计数
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6184 题意: n个点m条边的无向图,问有多少个A-structure 其中A-structure满足V ...
- flex弹性布局学习
一.介绍 flex( flexible box:弹性布局盒模型),是2009年w3c提出的一种可以简洁.快速弹性布局的属性.主要思想是给予容器控制内部元素高度和宽度的能力.目前已得到以下浏览器支持: ...
- .NET及.NET Core系统架构
三层及多层架构 Multitier Architecture ASP.NET N-Tier Architecture Schema Visual Studio N-Tier Example 来源:ht ...
- javascript中用setAttribute给元素添加colspan属性无效
先附上代码 var tr=document.createElement('TR'); var td=document.createElement('TD'); td.setAttribute('col ...
- 一种解决url的get请求参数传值乱码问题的方式
做项目的时候发现url get请求传中文字符出现乱码问题,百度了一下,最后用一种比较容易理解的方式解决了.分享给大家! 经过百度,网友提到:url get方式提交的参数编码,只支持iso8859-1编 ...