thymeleaf | modern server-side Java template engine

 by   thymeleaf Java Version: 3.1.2.RELEASE License: Apache-2.0

kandi X-RAY | thymeleaf Summary

kandi X-RAY | thymeleaf Summary

thymeleaf is a Java library typically used in Template Engine applications. thymeleaf has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has high support. You can download it from GitHub, Maven.

To learn more and download latest version:.

            kandi-support Support

              thymeleaf has a highly active ecosystem.
              It has 2552 star(s) with 472 fork(s). There are 125 watchers for this library.
              There were 1 major release(s) in the last 12 months.
              There are 92 open issues and 746 have been closed. On average issues are closed in 181 days. There are 7 open pull requests and 0 closed requests.
              It has a positive sentiment in the developer community.
              The latest version of thymeleaf is 3.1.2.RELEASE

            kandi-Quality Quality

              thymeleaf has 0 bugs and 0 code smells.

            kandi-Security Security

              thymeleaf has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              thymeleaf code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              thymeleaf is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              thymeleaf releases are available to install and integrate.
              Deployable package is available in Maven.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed thymeleaf and discovered the below as its top functions. This is intended to give you an instant insight into thymeleaf implemented functionality, and help decide if they suit your requirements.
            • Handle a standalone element
            • Compute processors
            • Reset all variables
            • Recompute the iterator
            • Handle an open tag
            • Increase the model level
            • Checks if the given open tag should be processed
            • Builds a set of dialect configurations
            • Wrap a IElementProcessor
            • Process an XML declaration
            • Process text content
            • Handle a doc type
            • Process comments
            • Process a CDATA section
            • Handle processing instruction
            • Handle a template end
            • Handle template start event
            • Get a string representation of this object
            • Processes an attribute
            • Process the binding
            • Does the actual processing of the template
            • Reads a character block from the input stream
            • Evaluate SpringEL expression
            • Build a link
            • Sets the context
            • Compares two values for equality
            Get all kandi verified functions for this library.

            thymeleaf Key Features

            No Key Features are available at this moment for thymeleaf.

            thymeleaf Examples and Code Snippets

            Send a message using Thymeleaf template
            javadot img1Lines of Code : 12dot img1License : Permissive (MIT License)
            copy iconCopy
                public void sendMessageUsingThymeleafTemplate(
                    String to, String subject, Map templateModel)
                        throws MessagingException {
                    Context thymeleafContext = new Context();
            The Thymeleaf view resolver bean .
            javadot img2Lines of Code : 7dot img2License : Permissive (MIT License)
            copy iconCopy
                public ViewResolver thymeleafViewResolver() {
                    final ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
                    return viewRes  
            Handles the Thymeleaf view .
            javadot img3Lines of Code : 6dot img3License : Permissive (MIT License)
            copy iconCopy
                public ModelAndView thymeleafView(Map model) {
                    model.put("number", 1234);
                    model.put("message", "Hello from Spring MVC");
                    return new ModelAndView("thymeleaf/index");

            Community Discussions


            Hugo with asciidoctor broken "can't find gem asciidoctor"
            Asked 2022-Apr-04 at 09:20

            I have an existing blog with Hugo and Asciidoctor, but running hugo server started failing. I first added the additional security configuration as explained in Hugo with Asciidoctor.

            But things are still not working, I get this error:



            Answered 2022-Feb-20 at 10:34

            I managed to make it work again by removing RVM completely from my system using the commands in



            Angular with Spring boot static does not work
            Asked 2022-Apr-02 at 10:49

            I have an spring boot app, which contains an angular front

            like this:


            Where in zanori2 I have the result of ng build some like:

            index.html, index.js, favico.ico and so on

            I tried this resourceHandle:



            Answered 2022-Apr-02 at 10:49
            Mapping of static assets

            Spring will automatically search in a number of places for paths which aren't matched by any controllers or other settings in the web config. These locations are currently checked by default:



            Show Output of Controller method via Thymeleaf
            Asked 2022-Feb-18 at 17:58

            I just started working on Thymeleaf and wanted to connect a Spring Boot application with HTML using Thymeleaf. I had my "normal" controllers without Thymeleaf like this:



            Answered 2022-Feb-18 at 13:30

            The String return type you use in a @Controller (as opposed to the @RestController you used before) indicates the name of the Thymeleaf template.

            Normally, I would use 2 templates:

            • book-list.html to show the list of books
            • book.html to show the details of a single book

            Those files need to be in src/main/resources/templates. Assuming you have that, your controller becomes:



            Cannot Load Image in Spring Boot
            Asked 2022-Feb-17 at 04:45

            I'm making a sport e-commerce website using Spring Boot and Thymeleaf and in the index of products page and edit page of a particular product, I can't view the image of the product. This is how the edit a product page (inspect on Chrome) looks

            Here's the HTML Code for Edit a product. The line below the current image is the one generating the error for both edit and index.



            Answered 2021-Sep-15 at 17:44

            In spring boot, pages are searched under "templates" folder and resources are mapped under "static" folder by default. To access an image file under static folder, try



            Thymeleaf - Check if array contains element with property
            Asked 2022-Jan-20 at 05:55

            I have a list of comments. Each comment has an attribute author. And each author has a username.

            I want to display a specific button only if the current user did not write a comment yet. (Which means there must be no comment in the list, where the username of the author equals user.username)

            This is what it would look like in JavaScript:



            Answered 2022-Jan-20 at 05:55

            You can try this is will replicate some function of javascript



            How to add the CSRF token to the HTTP header using fetch API and VanillaJS
            Asked 2022-Jan-12 at 04:15

            I am trying to send a POST-request to a server that is configured to use Spring Security. When submitting my request, I get a 403 error. This is issue is due to CSRF protection. When disabling CSRF in my Spring Security Configuration, the POST request works fine.

            I am using the fetch API to send my POST-request. This allows for specifying the HTTP-header that comes with the body containing my JSON-object that I am trying to POST. I am now trying to add the CSRF token to my HTTP-header. For this purpose, I have added the following two meta-tags to the head-section of my HTML:



            Answered 2022-Jan-12 at 04:15

            Add 'th' before the attribute for thymeleaf processing



            Getting values from enum in thymeleaf
            Asked 2022-Jan-02 at 11:29

            I'm using enum for select options in thymeleaf and I can't see them or insert them in the database. There is nothing in the dropdown list.



            Answered 2022-Jan-02 at 03:18

            that is available for me.




            ThymeLeaf SpringInputGeneralFieldTagProcessor' two th:fileds confilicting
            Asked 2021-Dec-30 at 02:18

            When I use create action is make me a problem for update action th:value=*{name} How to set th:field values to not conflict each other.

            Here is the error:

            There was an unexpected error (type=Internal Server Error, status=500). Error during execution of processor 'org.thymeleaf.spring5.processor.SpringInputGeneralFieldTagProcessor' (template: "designations" - line 243, col 18)

            Here is html



            Answered 2021-Dec-30 at 02:18


            The spring boot project cannot access static files
            Asked 2021-Dec-24 at 18:59

            I created a new springboot project, the directory structure of the project is as follows: enter image description here The yml configuration is as follows:



            Answered 2021-Dec-24 at 18:59

            I have found your error. You use the root context path spring-demo which is not applied to the relative path as needed

            You must change it into



            Spring RestTemplate and getForObject for Microservices issues
            Asked 2021-Dec-21 at 20:45

            I am working on exercises from a training program regarding Microservices and Spring Boot.

            I successfully configured: (1) a Eureka server, and (2) a toll rate service which is a client of the Eureka server. This toll rate service has port number 8085

            Now I am trying to configure:
            (3) a third service, which will be a dashboard that consume the API data from the toll rate service (and this dashboard also registers with Eureka server). This has port number 8087

            The issue is that, I am not able to display the dashboard using below code for the in (3):



            Answered 2021-Dec-21 at 20:45

            According to the described setup, particularly:


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install thymeleaf

            You can download it from GitHub, Maven.
            You can use thymeleaf like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the thymeleaf component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer For Gradle installation, please refer .


            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone thymeleaf/thymeleaf

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link