SpringBoot+Thymeleaf问题
springboot在controller返回数据到thymeleaf报404
用springboot做一个例子,访问controller可以返回数据,但是到thymeleaf却报404,
检查发现路径等没有问题,查阅资料得知
这是因为maven仓库jar包问题,把maven仓库中的所有jar包都删除了,然后重新下载,再启动项目
或者在pom文件的
properties
标签下加入
<thymeleaf.version>3.0.2.RELEASE</thymeleaf.version>
<thymeleaf-layout-dialect.version>2.1.1</thymeleaf-layout-dialect.version>
Thymeleaf页面的jquery无效
在<head>标签中写的jquery无效
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:include="fragment::header">
<meta charset="UTF-8">
<title></title>
<script>
...... // 此处会被覆盖
</script>
</head>
原因:使用 <head th:include="fragment::header"> 集中引入外部资源时,会覆盖原页面中的<head>标签,则<script>标签中的代码在页面源码会不存在
引入后的页面源码<head>:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link href="/css/style.css" rel="stylesheet"/>
<link href="/bootstrap/css/bootstrap.css" rel="stylesheet"/>
<script src="/js/jquery-3.0.0.min.js" type="text/javascript"></script>
<script src="/bootstrap/js/bootstrap.js" type="text/javascript"></script>
<title>fragment</title>
</head>
SpringBoot+Thymeleaf问题的更多相关文章
- org.springframework.expression.spel.SpelEvaluationException: EL1004E: Method call: Method service() cannot be found on com.my.blog.springboot.thymeleaf.util.MethodTest type
前言 本文中提到的解决方案,源码地址在:springboot-thymeleaf,希望可以帮你解决问题. 至于为什么已经写了一篇文章thymeleaf模板引擎调用java类中的方法,又多此一举的单独整 ...
- springboot+thymeleaf+pageHelper带条件分页查询
html层 <div> <a class="num"><b th:text="'共 '+ ${result.resultMap['pages ...
- springboot+thymeleaf简单使用
关于springboot想必很多人都在使用,由于公司项目一直使用的是SpringMVC,所以自己抽空体验了一下springboot的简单使用. 环境搭建 springbooot的环境搭建可以说很灵活, ...
- SpringBoot thymeleaf使用方法,thymeleaf模板迭代
SpringBoot thymeleaf使用方法,thymeleaf模板迭代 SpringBoot thymeleaf 循环List.Map ============================= ...
- SpringBoot thymeleaf模板页面没提示,SpringBoot thymeleaf模板插件安装
SpringBoot thymeleaf模板插件安装 SpringBoot thymeleaf模板Html页面没提示 SpringBoot thymeleaf模板页面没提示 SpringBoot t ...
- SpringBoot thymeleaf模板版本,thymeleaf模板更换版本
SpringBoot thymeleaf模板版本 thymeleaf模板更换版本 修改thymeleaf模板版本 ================================ ©Copyright ...
- Springboot+Thymeleaf框架的button错误
---恢复内容开始--- 在做公司项目时,遇到了一个Springboot+Thymeleaf框架问题: 使用框架写网站时,没有标明type类型的button默认成了‘submit’类型,每次点击按钮都 ...
- SpringBoot+Thymeleaf+iView
SpringBoot+Thymeleaf参考: https://www.cnblogs.com/kibana/p/10236187.html 1.Controller: package cn.mmwe ...
- layui表格数据渲染SpringBoot+Thymeleaf返回的数据时报错(Caused by: org.attoparser.ParseException: Could not parse as expression: ")
layui table渲染数据时报错(Caused by: org.attoparser.ParseException: Could not parse as expression: ") ...
- 不要再学 JSP 了,学 SpringBoot + Thymeleaf + Vue吧
老读者就请肆无忌惮地点赞吧,微信搜索[沉默王二]关注这个在九朝古都洛阳苟且偷生的程序员.本文 GitHub github.com/itwanger 已收录,里面还有我精心为你准备的一线大厂面试题. 读 ...
随机推荐
- Hangover POJ - 1003
How far can you make a stack of cards overhang a table? If you have one card, you can create a maxim ...
- tp3.2 模块单独配置数据库
一 $User = M('test','tp_','mysql://root:123456@localhost/new_lezhu#utf8'); 1.test -->表名 2.tp ...
- codecademy课程笔记——JavaScript Promise
Promise是一种表示异步操作最终的结果的对象,一个Promise对象有三种状态 Pending: 初始状态 ,操作还未完成 Fullfilled:操作成功完成,且这个promise现在有一个r ...
- MarkDown语言
参考: 参考:https://typora.io/ 参考:https://caret.io/ Markdown是一种轻量级标记语言,创始人为約翰·格魯伯(英语:John Gruber). 它允许人们“ ...
- Python 3+selenium+unittest+HTMLTestRunner生成测试报告
一.下载HTMLTestRunner.py,解压,将它放到 python安装路径的site-packages目录下 https://pan.baidu.com/s/1epWlibxbxWlNoIcxL ...
- Xposed免重启调试工具类
直接放代码 package com.xirtam.hello; import android.app.Application; import android.content.Context; impo ...
- oracle学习笔记第一天
oracle学习笔记第一天 --oracle学习的第一天 --一.几个基础的关键字 1.select select (挑选) 挑选出显示的--列--(可以多列,用“,”隔开,*表示所有列),为一条 ...
- nginx域名跳转到www下
- ASP.NET操作DataTable各种方法总结(给Datatable添加行列、DataTable选择排序等)
using System; using System.Collections.Generic; using System.Data; using System.Text; namespace Gz ...
- 常见查找算法(Java代码实现)
一,顺序查找 查找算法中顺序查找算是最简单的了,无论是有序的还是无序的都可以,只需要一个个对比即可,但其实效率很低.我们来看下代码 public static int search(int[] a, ...