pluginSession
This property is available to controllers and taglibs, to provide access to the session attributes for only the plugin that defines the controller or taglib.
Use this instead of session[xxxx]
in your plugin code, to prevent keys accidentally clashing across plugins and apps:
1 2 3 4 5 6 | class MyPluginController { def index = { pluginSession.message = "This is safe, even if app or other plugin uses [message]" } } |
The object returned is a PropertyNamespacer
instance, which supports property access, keySet() and toMap() to return only the keys and data
that is provided by the plugin.