I'm having some problems with accessing org.springframework.ui.Model
in a bean not annotated by @Controller
Using @AutoWired
fails in this bean and it isn't created. Similarly, if I try to make Model
a parameter to a method in this bean it is not injected and the method call fails silently.
The reason for the need is to supply dynamic data to some views in my site such as allowed links for a user, or custom welcome messages. Theses elements may not be on every page. I've seen some tempting frameworks like Tiles. View templates were working, but needed model element on partial views was not being populated.
I've seen similar posts such as Add attributes to the model of all controllers in Spring 3 but this would add to all views which is not correct in this case. Any help or pointing in the right direction would be appreciated.