Is there a way in Grails to run the contents of BootStrap.groovy after it has been changed without restarting the app?
You can do this with the console
plugin. I'd highly recommend this plugin for any development environment because it's so useful for running ad-hoc code inside a running server.
To rerun your BootStrap init
closure, browse to the web-based console at http://localhost:8080/appname/console
. Enter the following in the console:
def servletCtx = org.codehaus.groovy.grails.web.context.ServletContextHolder.servletContext
def myBootstrapArtefact = grailsApplication.getArtefacts('Bootstrap')[-1]
myBootstrapArtefact.referenceInstance.init(servletCtx)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With