#What is more "kosher" way to acces data from Thymealef template ?

7 messages · Page 1 of 1 (latest)

vale vine
#

Hi, I am curious what is more "kosher" way of accesing data from thymeleaf template... using:

  1. Model model
    or 2. using calling of controller methods ?

For example I need to get list of items to thymeleaf template, I can sent the "List items" via Model, or call it via someController.getListOfItems() directly in template

Or are they equal ?
Thanks

golden duneBOT
#

This post has been reserved for your question.

Hey @vale vine! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

azure patio
#

Sending it in via the model.
This is a similar idea to Global Variable access vs Passing in through a function

golden duneBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.

golden duneBOT
# vale vine thanks

If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.