You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just try to have a simple mechanism using javascript and read "variable" from controller java model (springboot)
When i use th:insert, it works. All the content of the .js files is well available in the HTML file
But
When i try via th:src, the behaviour is not the same,displaying "null"
I try to have the same behaviour but seems not possible ?
I think that when i use one or more th:insert process, i am on the same thread, so the model atttibute is "global" to all the .js file i insert.
When i use th:src i will be on a isolated thread for each .js requested... so individual model.addAttribute("","") has to be done ...
That's why it seems not working unfortunately
Have a nice end of day
The text was updated successfully, but these errors were encountered:
Hello
I just try to have a simple mechanism using javascript and read "variable" from controller java model (springboot)
When i use th:insert, it works. All the content of the .js files is well available in the HTML file
But
When i try via th:src, the behaviour is not the same,displaying "null"
Inside the common.js, i can log the variable.
I try to have the same behaviour but seems not possible ?
I think that when i use one or more th:insert process, i am on the same thread, so the model atttibute is "global" to all the .js file i insert.
When i use th:src i will be on a isolated thread for each .js requested... so individual model.addAttribute("","") has to be done ...
That's why it seems not working unfortunately
Have a nice end of day
The text was updated successfully, but these errors were encountered: