In grails, how do I get a reference to all current sessions?
问题 I'd like to list all current sessions in an Admin Controller in grails. What's the easiest way to get a reference to e.g. a Collection of sessions from the controller? 回答1: This is a feature (disabled by default but easily enabled by setting grails.plugins.appinfo.useContextListener = true in Config.groovy) of the App-Info plugin: http://grails.org/plugin/app-info 回答2: there is a "groovy" way to do this without a SessionListener, there are events generated that closures can be assigned to.