SpringBoot越来越受欢迎,而官方推荐的模板是thymeleaf ,但是其语法太过严格,使用过程中一不留心就会出现org.xml.sax.SAXParseException错误

其中主要是下面这些标签没有被正确关闭

<link>  <meta>  <head>  <hr>  <img>
<link/>  <meta/>  <head/>  <hr/>  <img/>

另外在thymeleaf 模板里使用js写>,<等符号都会报错,这里有一个方法很实用

<script type="text/javascript">
//<![CDATA[/**获得当前日期**/
function getDate01(){
var time = new Date();
var myYear = time.getFullYear();
var myMonth = time.getMonth()+1;
var myDay = time.getDate();
if(myMonth < 10){
myMonth = "0" + myMonth;
}
document.getElementById("yue_fen").innerHTML = myYear + "." + myMonth;
document.getElementById("day_day").innerHTML = myYear + "." + myMonth + "." + myDay;
}//]]>
</script> 就是用<![CDATA[ ]]>标签,在标签里面写js就不会报错,另外js可能会报无法识别<的错误,这时在其前面加上//即可,如上图所示

springboot thymeleaf org.xml.sax.SAXParseException错误的更多相关文章

  1. spring整合mybatis错误:Caused by: org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 62; 文档根元素 "mapper" 必须匹配 DOCTYPE 根 "configuration"。

    运行环境:jdk1.7.0_17+tomcat 7 + spring:3.2.0 +mybatis:3.2.7+ eclipse 错误:Caused by: org.xml.sax.SAXParseE ...

  2. webServices接口开发过程中项目启动遇到的错误org.xml.sax.SAXParseException; lineNumber: 20; columnNumber: 422; schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/beans/spring-bean

    org.xml.sax.SAXParseException; lineNumber: 20; columnNumber: 422; schema_reference.4: Failed to read ...

  3. Spring错误——Spring xml注释——org.xml.sax.SAXParseException; lineNumber: 24; columnNumber: 10; cvc-complex-type.2.3: 元素 'beans' 必须不含字符 [子级], 因为该类型的内容类型为“仅元素”。

    背景:配置spring xml,注释xml中文件元素 错误: Caused by: org.xml.sax.SAXParseException; lineNumber: 24; columnNumbe ...

  4. 坑爹的Hibernate 映射文件错误提示org.xml.sax.SAXParseException

    今天整整一个上午都在和hibernate做斗争,早上一来,继续昨天的项目开发,发现spring项目不能启动,从错误中看是hibernate错误,多半是hibernate配置有错误,关键是错误提示中显示 ...

  5. org.xml.sax.SAXParseException: 元素类型 "input" 必须由匹配的结束标记 "</input>" 终止。

    错误记录 Spring Boot推荐使用thymeleaf作为视图,按照SpringBoot实战一书的案例写Demo. 发生错误: org.xml.sax.SAXParseException: 元素类 ...

  6. java读取xml文件报“org.xml.sax.SAXParseException: Premature end of file” .

    背景:java读取xml文件,xml文件内容只有“<?xml version="1.0" encoding="UTF-8"?>”一行 java读取该 ...

  7. org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 6; 不允许有匹配 "[xX][mM][lL]" 的处理指令目标。

      Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: ### Error ...

  8. Caused by: org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 49; 前言中不允许有内容。

    今天刚开始学习mybatis时,自己去尝试使用mybatis链接数据库,操作数据局时,报了一个下面的错误 Caused by: org.xml.sax.SAXParseException; lineN ...

  9. Caused by: org.xml.sax.SAXParseException; systemId: file:/home/hadoop/hive-0.12.0/conf/hive-site.xml; lineNumber: 5; columnNumber: 2; The markup in the document following the root element must be well

    1:Hive安装的过程(Hive启动的时候报的错误),贴一下错误,和为什么错,以及解决方法: [root@master bin]# ./hive // :: INFO Configuration.de ...

随机推荐

  1. Python核心编程 课后练习 第二章

    2.4 使用raw_input()函数得到用户输入. (a) 创建一段脚本使用raw_input()函数从用户输入得到一个字符串, 然后显示这个用户杠杠输入的字符串. #coding = utf-8 ...

  2. CSS3自定义下拉框菜单

    在线演示 本地下载

  3. EntityFramework 学习 一 Spatial Data type support in Entity Framework 5.0

    MS SQl Server引进两种特殊的数据类型geography and geometry public partial class Course { public Course() { this. ...

  4. linux常见命令2

    systemctl set-hostname HOSTNAME  在centos7上设置主机名,永久有效 curl -O -L http://www.gnu.org/software/gettext/ ...

  5. codeforces 707D:Persistent Bookcase

    Description Recently in school Alina has learned what are the persistent data structures: they are d ...

  6. Thriftpy一个简单的例子

    sleep.thrift文件(什么是thrift文件?),文件内容如下,该文件定义了一个Sleep服务,该服务提供一个sleep方法,sleep方法接受一个32位int类型的参数且没有返回值 serv ...

  7. JS字符串转换成数字

    方法主要有三种 转换函数.强制类型转换.利用js变量弱类型转换. 1. 转换函数: js提供了parseInt()和parseFloat()两个转换函数.前者把值转换成整数,后者把值转换成浮点数.只有 ...

  8. beans.factory.BeanCreationException beans.factory.annotation.Autowired(required=true)

    主要是这三个方面排查: 1,注入写成这样 @Autowired   private BrandServiceImpl      brandServiceImpl; 2,jar冲突,在pom.xml中 ...

  9. vmware在桥接模式下配置centos7网络

    首先要将Vmware10.0.3设置为桥接模式. CentOS 7.0默认安装好之后是没有自动开启网络连接的! cd  /etc/sysconfig/network-scripts/  #进入网络配置 ...

  10. JS中的forEach、$.each、map方法推荐

    下面小编就为大家带来一篇JS中的forEach.$.each.map方法推荐.小编觉得挺不错的,现在分享给大家,也给大家做个参考.一起跟随小编过来看看吧 orEach是ECMA5中Array新方法中最 ...