question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Thymeleaf: "Template mode "TEXT" has not been configured

See original GitHub issue

spring-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:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
jmkgreencommented, Apr 10, 2017

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.

1reaction
philwebbcommented, Mar 6, 2018
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found