Oct 4th, 2011, 11:04 PM
common reference data to the model ala spring-mvc HandlerInterceptor...?
in the past, in spring-mvc applications, i have used HandlerInterceptor to add elements to the model that i *always* want to be there,
for instance, model elements that are expected by a site-wide sitemesh applied "chrome".
see strategy (4) in this post: http://developingdeveloper.wordpress...in-spring-mvc/
i'm looking for a similar solution for grails to setup common "reference" data in the model consistently to be used by a global sitemesh layout.
any one know of comparable grails strategies or if i can use <mvc:interceptor> as i might in a straight-up spring-mvc app?
i know i can use a grails filter, but not sure how to effect the "model" in a filter as i can in HandlerInterceptor.postHandle()
where i get a reference to ModelAndView...
any guidance appreciated!
Oct 5th, 2011, 10:28 AM
It's not clear from the docs but the "after" filter takes a model argument which is mutable. I've updated the docs and the template that's used to generate a new filters class.
See http://hudson.grails.org/job/grails_...ml#filterTypes for the latest docs build. It's the 2.0 docs but applicable to 1.3 since that hasn't changed for 2.0.
Oct 7th, 2011, 11:47 AM