
springboot学习笔记
文章平均质量分 62
个人学习springboot的学习记录
吓得吃小手手
这个作者很懒,什么都没留下…
展开
-
springboot thymeleaf 引入html公共模板
1.在templates文件下创建一个common文件夹,用于存放公共的头部创建一个html,在里面写公共的内容<!DOCTYPE html><html lang="en" xmlns:th="http://www.thymeleaf.org"><head> <meta charset="UTF-8"> <title>Title</title> <footer th:fragment="原创 2022-03-05 19:31:19 · 4241 阅读 · 0 评论 -
springboot 添加背景图片
1.目录结构1.图片不能放到templates中,自己试了显示不出来2.背景设置背景的路径和位置很重要,否则显示不出来结果:图片没有自适应我们在body中单独设置<body style=" background-repeat:no-repeat ; background-size:100% 100%; background-attachment: fixed;">实现效果:完整显示参考文章:https://blog.youkuaiyun.com/qq_364810原创 2022-03-05 11:00:50 · 4899 阅读 · 5 评论 -
springboot的Thymeleaf常用属性
目录标准变量表达式语法${...}th:text="${. . .}"URL表达式 @{. . .} th:href="@{...}"绝对路径(不带参数)绝对路径(带参数)相对路径(不带参数)相对路径(带参数)遍历列表list th:each遍历Mapth:text和th:value标准变量表达式语法${…}th:text="…"是Thymeleaf的一个属性,用于文本的显示th:text="${. . .}"例:<h1 th:text="${user.getId()}">原创 2022-01-19 22:34:40 · 1914 阅读 · 0 评论 -
SpringBoot集成Thymeleaf
这里写目录标题创建springboot工程集成2.1先写一个控制层2.2创建一个html(添加:xmlns:th="http://www.thymeleaf.org")2.3配置视图解析器(可省略)在application.properties2.4关闭页面缓存创建springboot工程集成2.1先写一个控制层2.2创建一个html(添加:xmlns:th=“http://www.thymeleaf.org”)修改:<html lang="en" xmlns:th="http://原创 2022-01-18 18:33:00 · 144 阅读 · 0 评论 -
springboot中的springmvc常用注解
在控制层中通常要在控制类加上常用注解@Controller@ResponseBody@RestController@RequestMapping@GetMapping@PostMapping@DeleteMapping@PutMapping@Controller@Controllerpublic class StudentController {@ResponseBody返回字符串或者JSON格式的数据,不返回JSP@RequestMapping("/update") @Respon原创 2022-01-14 11:39:09 · 241 阅读 · 0 评论 -
Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could
在springboot运行时,出现错误:Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.2022-01-13 22:03:32.247 ERROR 4056 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : *******************原创 2022-01-13 22:14:16 · 156 阅读 · 0 评论 -
springboot集成Mybatis以及逆向工程
创建一个springboot工程在pom中添加依赖:<!--MYSQL驱动--> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> <!--Mybatis整合springboo原创 2022-01-12 16:00:18 · 264 阅读 · 0 评论 -
idea中springboot项目运行:找不到或无法加载主类
在学习springboot的过程中刚刚创建一个springboot项目,点击运行出现:出现了这个问题我的解决办法:点击这个按钮,之后就可以运行了。暑假实践时,大部分问题都是因为maven引起的。。。。...原创 2022-01-09 21:10:47 · 537 阅读 · 0 评论 -
springboot集成jsp
此时,只是一个普通的文件夹成为web资源文件夹到这里基本结束了但是在pom.xml需要添加依赖:<!--引入springboot内嵌Tomcat对jsp的解析依赖,不添加解析不了 --><!-- 仅仅只是展示jsp页面,只添加以下一个依赖--> <dependency> <groupId>org.apache.tomcat.embed</groupId>原创 2022-01-09 22:03:06 · 202 阅读 · 0 评论