Thymeleaf template breaks controller #109

Closed
SebT opened this Issue Mar 27, 2014 · 6 comments

Comments

Projects
None yet
4 participants
@SebT
Contributor

SebT commented Mar 27, 2014

When you try to add a route in a controller using a Thymeleaf template html file that has no "th" attribute, all the routes from this controller become unavailable.
No errors appear in the wisdom console, just a log informing us that the routes are being deleted.

@cescoffier

This comment has been minimized.

Show comment
Hide comment
@cescoffier

cescoffier Mar 27, 2014

Member

Things are bit more complex. Wisdom is able to have more than one template engine at a time. Yes so far we only have thymeleaf but I hope to get more soon.

So we need a way to check if the file is a thymeleaf template or not. As thymeleaf is reading HTML files, it's hard to use the extension as discriminent, as other template may use the same extension.

The current check is very expensive and may lead to issues as this one. So we have to change.

I'm in favor of prepending a specific extension, such as 'welcome.thm.html'.

Wdyt ?

Member

cescoffier commented Mar 27, 2014

Things are bit more complex. Wisdom is able to have more than one template engine at a time. Yes so far we only have thymeleaf but I hope to get more soon.

So we need a way to check if the file is a thymeleaf template or not. As thymeleaf is reading HTML files, it's hard to use the extension as discriminent, as other template may use the same extension.

The current check is very expensive and may lead to issues as this one. So we have to change.

I'm in favor of prepending a specific extension, such as 'welcome.thm.html'.

Wdyt ?

@SebT

This comment has been minimized.

Show comment
Hide comment
@SebT

SebT Mar 27, 2014

Contributor

Why not folders named after the template engine ?
Or a setting in the pom pointing out what engine is used for the whole
project and/or for each template file ?
Le 27 mars 2014 21:12, "Clement Escoffier" notifications@github.com a
écrit :

Things are bit more complex. Wisdom is able to have more than one template
engine at a time. Yes so far we only have thymeleaf but I hope to get more
soon.

So we need a way to check if the file is a thymeleaf template or not. As
thymeleaf is reading HTML files, it's hard to use the extension as
discriminent, as other template may use the same extension.

The current check is very expensive and may lead to issues as this one. So
we have to change.

I'm in favor of prepending a specific extension, such as
'welcome.thm.html'.

Wdyt ?

Reply to this email directly or view it on GitHubhttps://github.com/wisdom-framework/wisdom/issues/109#issuecomment-38854599
.

Contributor

SebT commented Mar 27, 2014

Why not folders named after the template engine ?
Or a setting in the pom pointing out what engine is used for the whole
project and/or for each template file ?
Le 27 mars 2014 21:12, "Clement Escoffier" notifications@github.com a
écrit :

Things are bit more complex. Wisdom is able to have more than one template
engine at a time. Yes so far we only have thymeleaf but I hope to get more
soon.

So we need a way to check if the file is a thymeleaf template or not. As
thymeleaf is reading HTML files, it's hard to use the extension as
discriminent, as other template may use the same extension.

The current check is very expensive and may lead to issues as this one. So
we have to change.

I'm in favor of prepending a specific extension, such as
'welcome.thm.html'.

Wdyt ?

Reply to this email directly or view it on GitHubhttps://github.com/wisdom-framework/wisdom/issues/109#issuecomment-38854599
.

@barjo

This comment has been minimized.

Show comment
Hide comment
@barjo

barjo Mar 28, 2014

Member

I would rather not have to edit the pom, a convention sounds more easy to follow. As proposed, either having a special extension (e.g welcome.thm.html) or a folder for each template engine (e.g templates/thymeleaf) seems less constraining for the dev.

Member

barjo commented Mar 28, 2014

I would rather not have to edit the pom, a convention sounds more easy to follow. As proposed, either having a special extension (e.g welcome.thm.html) or a folder for each template engine (e.g templates/thymeleaf) seems less constraining for the dev.

@tleveque

This comment has been minimized.

Show comment
Hide comment
@tleveque

tleveque Mar 28, 2014

I got the same problem.
+1 for specific extension, such as 'welcome.thm.html'.

I got the same problem.
+1 for specific extension, such as 'welcome.thm.html'.

@cescoffier

This comment has been minimized.

Show comment
Hide comment
@cescoffier

cescoffier Mar 28, 2014

Member

Ok, it's good to me. I will change that later today.

Sent from my iPhone

On 28 mars 2014, at 11:19, Thomas Leveque notifications@github.com wrote:

I got the same problem.
+1 for specific extension, such as 'welcome.thm.html'.

Reply to this email directly or view it on
GitHubhttps://github.com/wisdom-framework/wisdom/issues/109#issuecomment-38904725
.

Member

cescoffier commented Mar 28, 2014

Ok, it's good to me. I will change that later today.

Sent from my iPhone

On 28 mars 2014, at 11:19, Thomas Leveque notifications@github.com wrote:

I got the same problem.
+1 for specific extension, such as 'welcome.thm.html'.

Reply to this email directly or view it on
GitHubhttps://github.com/wisdom-framework/wisdom/issues/109#issuecomment-38904725
.

@cescoffier

This comment has been minimized.

Show comment
Hide comment
@cescoffier

cescoffier Mar 29, 2014

Member

From now, templates must have the extension '.thl.html'.

Member

cescoffier commented Mar 29, 2014

From now, templates must have the extension '.thl.html'.

@cescoffier cescoffier modified the milestone: 0.4.0 Apr 4, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment