Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Spring
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Spring
Th:replace doesn't accept the path if I generate it but works if it is hardcoded
Mike Grabl-j
Greenhorn
Posts: 13
posted 3 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
<p th:text="'themes/'+${theme}+'/general/footer::footer(theme=' + ${theme} +')'">test</p> <footer th:replace="themes/holmes/general/footer::footer(theme=holmes)">Footer</footer> <!--<footer th:replace="'themes/' + ${theme} + '/general/header::header(theme=' + ${theme} + ')'">Footer</footer>-->
This code works. That text in < p > is printed here for debug purpose. The variable theme contains 'holmes'. The code produces this HTML fragment:
<p>themes/holmes/general/footer::footer(theme=holmes)</p>
Well, I hoped the commented code would work. But no, it doesn't.
This exception occurs:
org.thymeleaf.exceptions.TemplateInputException: Error resolving template ['themes/' + ${theme} + '/general/header], template might not exist or might not be accessible by any of the configured Template Resolvers (template: "themes/holmes/posts/postList" - line 14, col 9)
Could you help me understand why? And how to fix?
Hey, sticks and stones baby. And maybe a wee mention of my stuff:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
parametrized fragment : template can not be resolved(thymeleaf)
file upload in spring boot using thymeleaf, java api, mysql
Preselect dropdown using thymeleaf
How to embed JForum in an existing application ?
Different themes in one installation
More...