Results 1 to 3 of 3

Thread: common reference data to the model ala spring-mvc HandlerInterceptor...?

  1. #1
    Join Date
    Jul 2005
    Posts
    111

    Default 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!

  2. #2
    Join Date
    Jul 2007
    Posts
    123

    Default

    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.

  3. #3
    Join Date
    Jul 2005
    Posts
    111

    Default

    nice, thanks burt!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •