Thymeleaf: "Template mode "TEXT" has not been configured
See original GitHub issuespring-boot:1.5.2 w/ spring-boot-starter-thymeleaf
I need to write an @Controller that will deliver a .txt file to a third party commercial application. This seems harder than it should.
According to https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html under # THYMELEAF I require the following properties:
--spring.thymelead.content-type=text/plain
--spring.thymeleaf.mode=TEXT
--spring.thymeleaf.suffix=.txt
This does not result in the downloading of my src/main/resources/templates/updates.txt with run-time values applied but an error page telling me that “TEXT” has not been configured.
I was hoping given the available configuration properties and thymeleaf’s claim that everything works “out of the box” this would be all that was required. It seems not 😦
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Spring and Thymeleaf: Template mode "HTML" has not been ...
The line "spring.thymeleaf.mode=HTML" from pet clinic project somehow had no effect on that project, but in mine - it did have.
Read more >Tutorial: Using Thymeleaf
The TEXT template mode will allow the use of a special syntax for templates of a non-markup nature. Examples of such templates might...
Read more >Spring Boot Thymeleaf configuration - ZetCode
When Spring Boot finds Thymeleaf dependency in the Maven POM file, it automatically configures Thymeleaf template engine. This tutorial shows ...
Read more >Spring Boot Reference Documentation
Absolutely no code generation and no requirement for XML configuration. 4.2. System Requirements. Spring Boot 3.0.0 requires Java 17 and is compatible up...
Read more >Getting started with Thymeleaf 3 text templates - Codeleak.pl
TemplateMode #TEXT)) templates in Thymeleaf allow creating templates with no markup. Such templates can be used to genere non-HTML content like ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

For anyone else hitting this problem it is because spring-boot:1.5 depends on thymeleaf 2.x which does not support more than XML and HTML.
Or https://docs.spring.io/spring-boot/docs/1.5.x/reference/htmlsingle/ is you want the latest 1.5 release.