Integration and use of front-end template engine Thymeleaf

Thymeleaf is a Java-based template engine that can process and generate HTML, XML, JavaScript, CSS and text. It supports running in both web and non-web environments and integrates well with frameworks such as Spring MVC. Thymeleaf syntax is simple and intuitive, making it easy to learn and use. Thymeleaf’s syntax mainly includes the following aspects: […]

Use Spring Boot, ConcurrentHashMap, Thymeleaf and Bootstrap to implement user caching functions

Original Lutiao Programming Lutiao Programming 2023-10-11 08:00 Published in Hebei included in collection #cache3 #SpringBoot75 This series of courses will cover many key technologies and tools of Spring Boot, including Mybatis-Plus, Redis, Mongodb, MinIO, Kafka, MySQL, Message Queuing (MQ), OAuth2 and other related content. Use Spring Boot, ConcurrentHashMap, Thymeleaf and Bootstrap to implement user caching […]

java uses template engine thymeleaf to export html to PDF document

java uses template engine thymeleaf to export html to PDF document Goals and technologies: Preface: This article is based on the premise that a new Maven project has been created. Goal: Use the Java template engine thymeleaf to export html dynamic templates to PDF documents Related dependencies: <!–web starting dependencies–> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <version>2.0.3.RELEASE</version> </dependency> […]

Thymeleaf exception:Exception processing template “index“: An error happened during template parsing (templ

The Spring Boot project runs without problems in Spring Tool Suite 4, Version: 4.4.0.RELEASE. Copy the static resources and pages in the project to the IDEA project. Except for the IDE, everything else is basically the same. When I run the project in IDEA and then access it, an exception occurs: Exception processing template “index”: […]

org.thymeleaf.TemplateEngine: [THYMELEAF][http-nio-8080-exec-7] Exception processing

2020-02-29 18:11:03.518 ERROR 288 — [nio-8080-exec-7] org.thymeleaf.TemplateEngine: [THYMELEAF][http-nio-8080-exec-7] Exception processing template “admin/tags”: An error happened during template parsing (template: “class path resource [templates/admin/tags.html]”) org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: “class path resource [templates/admin/tags.html]”) at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse(AbstractMarkupTemplateParser.java:241) at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parseStandalone(AbstractMarkupTemplateParser.java:100) at org.thymeleaf.engine.TemplateManager.parseAndProcess(TemplateManager.java:666) at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1098) at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1072) at org.thymeleaf.spring5.view.ThymeleafView.renderFragment(ThymeleafView.java:362) at org.thymeleaf.spring5.view.ThymeleafView.render(ThymeleafView.java:189) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1373) at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1118) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1057) […]

SpringSecurity integrates thymeleaf and image verification code

SpringSecurity integrates thymeleaf When the user does not have a certain permission, the button will not be displayed on the page Add dependencies: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope> </dependency> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.2.2</version> </dependency> <dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> <dependency> <groupId>org.thymeleaf.extras</groupId> <artifactId>thymeleaf-extras-springsecurity5</artifactId> </dependency> Create application.yml: spring: # data source datasource: driver-class-name: com.mysql.cj.jdbc.Driver […]

Javaee SSM framework project integration thymeleaf project structure chart

Build ssm framework project Refer to this blog Introduce thymeleaf Introduce jar package <?xml version=”1.0″ encoding=”UTF-8″?> <project xmlns=”http://maven.apache.org/POM/4.0.0″ xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd”> <modelVersion>4.0.0</modelVersion> <groupId>org.example</groupId> <artifactId>testSSM2</artifactId> <version>1.0-SNAPSHOT</version> <packaging>war</packaging> <name>testSSM2 Maven Webapp</name> <!– FIXME change it to the project’s website –> <url>http://www.example.com</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.target>1.7</maven.compiler.target> </properties> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.11</version> <scope>test</scope> </dependency> <!– 1. Import Spring-related […]

springboot— static resource and template engine thymeleaf

Seven. Static resources and template engine 7.1, Static Resource Mapping By default, Spring Boot serves static content from a directory called /static (or /public or /resources or /META-INF /resources) in the classpath or from the root of the ServletContext. 7.1.1, default mapping The official documentation tells us that Spring Boot’s mapping directories for static resources […]

Thymeleaf template reports error when SpringBoot+layui implements table data rendering and conditional query

ERROR 15028 – [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed ; nested exception is org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: “class path resource [templates/admin/user_list.html]”)] with root cause Error reason 2023-09-15 15:47:12.799 ERROR 15028 — [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context […]

Mybatis dynamic language – mybatis-thymeleaf

Earlier we introduced the use of Mybatis dynamic SQL; in this article we introduce the use of mybatis-thymeleaf dynamic language to generate dynamic SQL. If you don’t know much about Mybatis dynamic SQL, it is recommended that you understand it first before reading this article. You can refer to: Mybatis dynamic SQL – use if, […]