layout with spring boot 2.0.3

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

layout with spring boot 2.0.3

BeRoots
This post was updated on .
Hi :)

I have a problem that I can not solve with spring boot 2.0.3 and thymeleaf 3.0.9 (sping 5). On my demo version with spring boot 1.5.14 I use a LayoutDialect for thymeleaf and it work nice. In version 2.0.3 of spring boot I can not use this layout. Here are the git version 1.5 and 2 (https://github.com/BeRoots/spring-boot-1.5.14/tree/fix-localization and https://github.com/BeRoots/spring-boot-2-demo).

As you will see in version 2 I do not have the links defined in the <body> of app-layout.html. If anyone will have the solution. Thank you in advance.
Reply | Threaded
Open this post in threaded view
|

Re: layout with spring boot 2.0.3

BeRoots
If I add thymeleaf-layout-dialect.2.3.0 as dependency in my pom.xml I have a warning that says "duplicate managed version 2.3.0 for thymeleaf-layout-dialect".

But I can not import it with the namespace nz.net.ultraq.thymeleaf.LayoutDialect without this extra dependency in pom.xml. I haven't test with extra dependency but it's stupid if a version is already include by spring-boot 2.

If someone has an idea ;)
Reply | Threaded
Open this post in threaded view
|

Re: layout with spring boot 2.0.3

Reiju
This post was updated on .
Try next:
1. Remove class SpringWebConfig.java at all - u can specify thymeleaf settings in application.properties (for example - spring.thymeleaf.cache=false)

2. Add dependency to pom.xml:
<dependency>
         <groupId>nz.net.ultraq.thymeleaf</groupId>
         <artifactId>thymeleaf-layout-dialect</artifactId>
</dependency>

3. layout:decorate="~{app-layout}"

Result:

No warnings or errors.
Reply | Threaded
Open this post in threaded view
|

Re: layout with spring boot 2.0.3

BeRoots
Ok. It's work effectivly but STS ide (Sprint Tools Suite based on Eclipse) my pom.xml have no error into the document but an error is display on the pom.xml in the package explorer.

If you have an idea about this ;)
Reply | Threaded
Open this post in threaded view
|

Re: layout with spring boot 2.0.3

BeRoots
I have created a new project same as my example and the error on pom.xml does not reappear. No doubt a mistake of manipulation. The problem is now solved

Thank you.