grails ui MenuTagLib singleton behaviour causing problems

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

grails ui MenuTagLib singleton behaviour causing problems

Gaurav Pandey

Hi all,

         Default singleton behavior of MenuTagLib is causing problems in a multi user application. As  MenuTagLib is singleton and hence it’s instance variable MenuItemList items is shared for all users.

MenuTagLib.groovy has Following code :-


 def menubar = { attrs, body ->

        attrs = grailsUITagLibService.establishDefaultValues(


                        id: grailsUITagLibService.getUniqueId(),





        // fail-fast if someone is trying to use a menubar within a menu

        if (items != null) {

            throw new GrailsUIException("Cannot create a menubar within a menu.")





Since all users have same instance MenuTagLib and hence items will not be null fir 2nd user.


Is there any way to set MenuTagLib scope to request?





This message and any attachments originate from International Decision Systems (IDS) and contains
privileged and/or confidential information. If you receive this message in error or are not the intended
recipient, you may not disseminate this message and you are requested to erase all copies of this
message and its attachments and contact the sender by email or by calling +91 80 66448800.