What is the use of bootstrap.groovy?

devquora
devquora

Posted On: Feb 22, 2018

 

Sometimes a situation occurs in which a particular task is to be carried out every time the application starts or stops.”bootstrap.groovy” is used for this particular situation. It is a simple plain groovy script which has two important closures: the “init” and “destroy” files. So, whenever the application starts or stops, these closures are called upon respectively. This “bootstrap.groovy” is present inside the grails-app/conf folder. It is used to define a code whenever the application performs any function.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Java Grails Interview Questions

    What are the best practices to be followed while developing a grails application?

    Building an application using grails framework is quite easy. But, when building it the right way we need to follow the..

    Java Grails Interview Questions

    What do you mean by scaffolding? How do we use it?

    Scaffolding is used to generate some basic CRUD interfaces for a domain class. It includes the necessary views and some..

    Java Grails Interview Questions

    What do you mean by closures?

    A closure is a short and anonymous block of code which is just used to span a few lines of code. This block of code can..