I am new to Play 2.0, however, I think you better work using the plugin. Check this:
https://github.com/typesafehub/play-plugins/tree/master/inject
Using this approach, you simply add the following line to the controller (and some other configuration as described in the link above):
@Inject static MyStaticObj obj;
And everything else is done automatically using the injection framework. No need to worry about global etc.
However, like you, I spent a lot of time figuring out how to use the GlobalSettings object to do this before opening the plugin implementation infrastructure.
I believe that given how Global is implemented (as a class in a standard / unnamed package), it is not possible to refer to it anywhere in the application code. I'm not sure if it was by design or by accident (it seems that Play people think about Scala quite a bit these days ...). Fortunately, the plugin approach seems to be the best way to handle these common global variables.
kpw
source share