Thymeleaf: Intellij code assistance for model object inside fragment

Answered

Hi,

I am currenttly starting with Thymeleaf and I have some doubts about how to achieve this or if its even possible. (Have to say that the web works , but suggestions dont)

I want intellij to recognize (Or at least dont get an error) the properties of a model object inside a fragment (contained in the html who has access to the model)

I have been trying several options , but none of them worked. Elaborating with some images.

TestController.java:

index.html:

fragments/example.html:

fragments/example2.html:

fragments/example3:

GitHub project:

https://github.com/MSChristian/thymeleaf-fragments-test.git

Thank you.

0
3 comments
Avatar
Liubov Melnikova

What is the version of Intellij that you are using (Help | About)? As a workaround you can use Alt+Enter shortcut to invoke intention "Declare external variable in comment annotation" in order to get rid of "unresolved model attribute" in your views.

0
Avatar
Permanently deleted user

Im using Intellij IDEA Ultimate 2018.3.5.

The workarround works well, still wodering if there is no other solution.

Thank you very much!

 

 

0
Avatar
Liubov Melnikova

Your issue is similar to https://youtrack.jetbrains.com/issue/IDEA-132738 , please file a new bug report for the same developer on tracker.

0

Please sign in to leave a comment.