Search This Blog

Monday, February 21, 2011

Registering new bean classes in grails application programmatically

As part of amazing goodies of grails is the ability to extend your applications -  registering new classes programmaticaly is a breeze
As the grails guru Burt points out here it just requires minimal effort;

//first create a bean definition
def myBeanDef = new GenericBeanDefinition()
//set bean class
myBeanDef.setBeanClass(YourBeanClass)
//set scope
myBeanDef.setScope(BeanDefinition.SCOPE_SINGLETON)
//set others

//register
grailsApplication.mainContext.registerBeanDefinition "someName", myBeanDef 

Programming in grails is really a pleasure.

Saturday, February 12, 2011

Using Amazon SES from grails application

This summary is not available. Please click here to view the post.