thymeleaf

springboot整合Shiro

僤鯓⒐⒋嵵緔 提交于 2021-01-13 17:50:20
1.创建一个springboot项目 选中web和thymeleaf 1.1新建index.html <!DOCTYPE html > < html lang = "en" xmlns:th = "http://www.thymeleaf.org" > < head > < meta charset = "UTF-8" > < title > Title </ title > </ head > < body > < h1 > 首页 </ h1 > < p th:text = "${msg}" > </ p > </ body > </ html > 1.2创建一个controller package com.yao.controller; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind. annotation .RequestMapping; @Controller public class MyController { @RequestMapping({ "/" , "/index" }) public String toIndex(Model model){ model

Spring Boot 2.x基础教程:实现文件上传

邮差的信 提交于 2021-01-08 18:28:27
文件上传的功能实现是我们做Web应用时候最为常见的应用场景,比如:实现头像的上传,Excel文件数据的导入等功能,都需要我们先实现文件的上传,然后再做图片的裁剪,excel数据的解析入库等后续操作。 今天通过这篇文章,我们就来一起学习一下如何在Spring Boot中实现文件的上传。 动手试试 第一步 :创建一个基础的Spring Boot项目,如果还不会的话就先看看这篇 《快速入门》 。 第二步 :在 pom.xml 中引入模版引擎依赖: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> 你也可以选择其他你熟悉的模版引擎,比如:Freemarker。 第三步 :在 resources 目录下,创建新目录 templates ;在 templates 目录下再创建一个文件上传的页面 upload.html ,内容如下: <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8" /> <title>文件上传页面</title> </head> <body> <h1>文件上传页面</h1> <form method=

SpringBoot2.4 静态资源加载问题

微笑、不失礼 提交于 2021-01-08 15:58:12
标题index界面加载问题 刚开始学习springBoot记录一下遇到的小问题 \ 1.index.html加载不出来的问题 我习惯性的将index.html放在public包下 而我使用了thymeleaf,它内置的视图解析器,屏蔽了springBoot的默认视图解析器,只会从templates包下读取视图资源,我将index.html拉到templates包下时就可以正常显示了 2.static包下静态资源加载不出来的问题 看了很多网上大多说的都是配置文件的问题,试了半天都不管用,静下心来从头整理一遍发现自己在配置无业务跳转时关于404页面配置错了 对mvc配置进行扩展时,没意识到该路径映射优先于默认的映射,匹配到 /* 时就不再往下走了 3.thymeleaf引用路径问题 @{/**/**.css} 引用的连接前需要有 / 表示指向项目根目录 来源: oschina 链接: https://my.oschina.net/u/4326248/blog/4885045

接口测试平台

丶灬走出姿态 提交于 2021-01-05 07:35:50
接口测试平台 2018-04-12 1 好接口测试平台具备的特质(一站式,快速,便捷) l 用例管理:便于创建、维、组织用例、查询、评估 l 执行管理:便于执行(筛选执行用例、执行调度(立即、定时、周期性)/用例执行计划、并发执行(执行效率) l 便于对执行结果校验、分析、问题定位 l 便于统计(执行率、通过率、覆盖率、工作量、用例和bug分布、趋势) l 日志系统:用例、场景、执行计划的执行结果历史日志 l 测试报告(不同的形式:网页、Excel、pdf,报告模版、配置,报告合并) l 测试报表(不同时间,不同被测模块) 2 主要功能演示 2.1 主要功能模块 图1 功能模块 2.2 用例管理 图2 用例列表搜索 图3用例主体 2.3 参数管理 前置后置参数vs普通参数 前置后置参数可以载用例内,用例间(场景内)传递,而普通参数不能 参数类型 图4 参数类型 2.4 用例vs场景 场景:由关联的用例组成 图5 用例与场景如何区分 2.5 测试执行计划 图6 测试执行计划 3 待完善 l 用户权限功能 l 覆盖率统计功能 l 报告邮件功能 l 界面优化,使之更易用 l 前后端分离 l … bootstrap+thymeleaf+springboot+mybatis+mysql+tomcat 参考 Bootstrap 教程 Spring MVC 学习总结(二)——控制器定义与

Thymeleaf + Spring Boot: Error Page

我们两清 提交于 2021-01-05 07:00:29
问题 I have a basic SpringBoot app. using Spring Initializer, embedded Tomcat, Thymeleaf template engine, and package as an executable JAR file I want to redirect all the application Errors to a common page. I've created this controller: @Controller public class AppErrorController implements ErrorController { /** * Error Attributes in the Application */ private ErrorAttributes errorAttributes; private final static String ERROR_PATH = "/error"; /** * Controller for the Error Controller * @param

Thymeleaf + Spring Boot: Error Page

怎甘沉沦 提交于 2021-01-05 06:55:13
问题 I have a basic SpringBoot app. using Spring Initializer, embedded Tomcat, Thymeleaf template engine, and package as an executable JAR file I want to redirect all the application Errors to a common page. I've created this controller: @Controller public class AppErrorController implements ErrorController { /** * Error Attributes in the Application */ private ErrorAttributes errorAttributes; private final static String ERROR_PATH = "/error"; /** * Controller for the Error Controller * @param

这 5 个能挣钱的 SpringBoot 项目,真TMD香!

点点圈 提交于 2021-01-04 17:21:47
关注我 们, 设为星标,每天7:30不见不散,架构路上与您共享 回复" 架构师 "获取资源 不得不佩服 Spring Boot 的生态如此强大,今天我给大家推荐几款 Gitee 上优秀的后台开源版本的管理系统, 小伙伴们再也不用从头到尾撸一个项目了,简直就是接私活,挣钱的利器啊 。 SmartAdmin 我们开源一套漂亮的代码和一套整洁的代码规范,让大家在这浮躁的代码世界里感受到一股把代码写好的清流!同时又让开发者节省大量的时间,减少加班,快乐工作,热爱生活。SmartAdmin 让你从认识到忘不了,绝对是你最想要的! 项目地址: https://gitee.com/lab1024/smart-admin litemall 又一个小商场系统,Spring Boot后端 + Vue管理员前端 + 微信小程序用户前端 + Vue用户移动端。 项目地址: https://gitee.com/linlinjava/litemall Timo TIMO后台管理系统,基于SpringBoot2.0 + Spring Data Jpa + Thymeleaf + Shiro 开发的后台管理系统,采用分模块的方式便于开发和维护,支持前后台模块分别部署,目前支持的功能有:权限管理、部门管理、字典管理、日志记录、文件上传、代码生成等,为快速开发后台系统而生的脚手架! 技术选型 后端技术

这 5 个能挣钱的 SpringBoot 项目,真 TMD 香!

血红的双手。 提交于 2021-01-04 15:21:42
点击上方“ 逆锋起笔 ”, 公众号回复 pdf 领取大佬们推荐的学习资料 不得不佩服 Spring Boot 的生态如此强大,今天我给大家推荐几款 Gitee 上优秀的后台开源版本的管理系统, 小伙伴们再也不用从头到尾撸一个项目了,简直就是接私活,挣钱的利器啊 。 SmartAdmin 我们开源一套漂亮的代码和一套整洁的代码规范,让大家在这浮躁的代码世界里感受到一股把代码写好的清流!同时又让开发者节省大量的时间,减少加班,快乐工作,热爱生活。SmartAdmin 让你从认识到忘不了,绝对是你最想要的! 项目地址: https://gitee.com/lab1024/smart-admin litemall 又一个小商场系统,Spring Boot后端 + Vue管理员前端 + 微信小程序用户前端 + Vue用户移动端。 项目地址: https://gitee.com/linlinjava/litemall Timo TIMO后台管理系统,基于SpringBoot2.0 + Spring Data Jpa + Thymeleaf + Shiro 开发的后台管理系统,采用分模块的方式便于开发和维护,支持前后台模块分别部署,目前支持的功能有:权限管理、部门管理、字典管理、日志记录、文件上传、代码生成等,为快速开发后台系统而生的脚手架!关注公众号 逆锋起笔,回复 pdf

Share data via thymeleaf fragment

孤街醉人 提交于 2021-01-03 06:28:44
问题 I have a thymeleaf fragment called nav which I include in all front-end pages, it goes like so: <nav class="navbar navbar-expand-md navbar-dark bg-dark" th:fragment="nav"> <div class="collapse navbar-collapse" id="navbarsExampleDefault"> <ul class="navbar-nav mr-auto"> <li class="nav-item active"> <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a> </li> How to get Java data here ? </ul> </div> </nav> But what I want to do now is get some data from the database and

通过注解的方式整合 MyBatis + Spring Boot

徘徊边缘 提交于 2020-12-31 10:12:48
目录 目录 1. 前言 2. 整合过程 2.1 新建 Spring Boot 项目 2.2 添加 pom 依赖 2.3 准备数据库 2.4 pojo 层 2.5 dao 层 2.7 controller 层 2.8 入口程序配置 2.9 网页测试 1. 前言 本篇博客主要利用 SpringBoot 通过注解的方式整合 Mybatis,所有涉及的代码已经上传 Github mybatis-annotation [1] 。下面是整个整合过程,接下来开始整合: 2. 整合过程 最终项目结构如下图所示: 2.1 新建 Spring Boot 项目 新建一个 Spring Boot 项目,添加 Web 组件,具体过程可以参照我的另一篇博客 创建 Spring Boot 项目的三种方式 [2] 。 2.2 添加 pom 依赖 由于要整合 MyBatis,所以我们需要在项目的配置文件 pom.xml 中添加 mysql 驱动和 SpringBoot MyBatis 整合包; <!-- springboot mybatis 整合包 --> < dependency > < groupId > org.mybatis.spring.boot </ groupId > < artifactId > mybatis-spring-boot-starter </ artifactId > <