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
Post a Comment