bootstrapping - Grails instantiates object and uses in Controllers -



bootstrapping - Grails instantiates object and uses in Controllers -

i have application needs instantiate 1 object, thinking of singleton, before jump in that, thinking of dependency injection. is, instantiate object , setattribute servletcontext in bootstrap.groove , utilize object in every controller. understanding bootstrap called 1 time during application lifetime? that?

you can define singleton beans in resources.groovy

beans = { mybean(my.company.mybeanimpl) { singleton true } }

then in controllers

class examplecontroller { def mybean }

all documented here: http://www.grails.org/doc/latest/guide/14.%20grails%20and%20spring.html

grails bootstrapping

Comments

Popular posts from this blog

java - How to pass parameters between Request-Scoped Controllers? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -

ms access - C# - Using OleDbParameter on table name -