Comments (4)
Your Spring configuration looks alright, at first sight. The TilesConfigurer bean is independent, there is no relation between it and the other beans and that is normal (it mimics the behaviour of Spring's own TilesConfigurer).
Are you receiving any errors? If so, how do they look like?
from thymeleaf-extras-tiles2.
Yes, I'm sorry, I forgot to write the error:
javax.servlet.ServletException: Could not resolve view with name 'welcometiles' in servlet with name 'springDispatcher'
it seems like tile's configuration it is not ok, but I think it is! I'll let you know when the solution is made...
Tiles:
<definition name="baselayout" template="/WEB-INF/templates/baselayout.html">
<put-attribute name="title" value="Template" type="string" />
<put-attribute name="header" value="header.html" />
<put-attribute name="menu" value="menu.html" />
<put-attribute name="body" value="body.html" />
<put-attribute name="footer" value="footer.html" />
</definition>
<definition name="welcometiles" extends="baselayout">
<put-attribute name="title" value="Welcome" type="string" />
<put-attribute name="body" value="welcome.html" />
</definition>
from thymeleaf-extras-tiles2.
Hi again,
Now I can see your definitions, I can see the errors in your configuration.
Your view resolver (Thymeleaf's) can specify the view names it can resolve by means of the viewNames
attribute. In your configuration, it reads like this:
<property name="viewNames" value="*.html, *.xhtml, *.xml" />
Which means that the ThymeleafViewResolver
will only consider it can handle a view if its name ends with *.html
, *.xhtml
, etc.
But your view is called welcometiles
. It doesn't end with any of those suffixes.
The fact is that the viewNames
property in view resolvers is only useful when your application has more than one of these (for example, if you are using Thymeleaf for some pages and JSP for some other pages), so that each view resolver can know whether the requested views should be resolved by it or not. So if you don't have more than one view resolver... I would simply remove that property.
But there are some additional problems in your Tiles configuration: you are specifying a template like /WEB-INF/templates/baselayout.html
, but your Thymeleaf template resolver is already configured to add the /WEB-INF/templates/
prefix and the .html
suffix to any template name it is requested, so asking for this template would result in actually looking for /WEB-INF/templates//WEB-INF/templates/baselayout.html.html
.
You should simply specify your template as baselayout
. And the same goes for header
, menu
, body
, etc.
Regards,
Daniel.
from thymeleaf-extras-tiles2.
yes! it worked... thanks!
from thymeleaf-extras-tiles2.
Related Issues (20)
- Migration to tiles 3 HOT 1
- mvn clean:clean install gets stuck at maven-gpg-plugin:1.1:sign HOT 2
- Is there an equivalent to tiles:insertDefinition HOT 1
- How to use EL for jsp type attribte in tiles template definitions file? HOT 1
- Getting Tiles' put-list-attribute to work with a Thymeleaf template
- Adapt to modifications in fragments in thymeleaf core
- Create tiles:replace to match new th:replace HOT 1
- tiles:ignore="true" HOT 2
- Please add support for spring @PathVariable
- ThymeleafTilesView to expose Thymeleaf's own evaluation context as a model variable in order to support ConversionService HOT 2
- Lack of support for thymeleaf-spring4
- How to use ViewPreparer?
- Tiles +Thymeleaf integration problem HOT 1
- Support Tiles 3 HOT 13
- NullPointerException on null model in ThymeleafTilesView HOT 1
- ThymeleafTilesView is not of type ThymeleafView HOT 4
- Try to avoid the possible creation of new sessions HOT 1
- Evaluate standard expressions in type="string" tiles attributes
- tiles:insertDefinition HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thymeleaf-extras-tiles2.