Spring view resolver does not apply static model attributes
In all Spring view resolvers, there is a property org.springframework.web.servlet.view.UrlBasedViewResolver#setAttributesMap which is used to populate the model for all views with predefined attributes. Unfortunately, ScalateViewResolver does not employ this. The fix could be very simple: in ScalateView#renderMergedOutputModel() just add a call to org.springframework.web.servlet.view.AbstractView#createMergedOutputModel before passing the model to Scalate.
Leave a comment
on 2013-04-09 12:58 *
By stefan.gheorghiu
Actually, the solution would be to add the following line of code: view.setAttributesMap(getAttributesMap) in the end of ScalateViewResolver#buildView