用Grails重新加载引导

用Grails重新加载引导,grails,Grails,Grails中有没有一种方法可以在BootStrap.groovy的内容被更改后运行它而不重新启动应用程序 您可以使用。我强烈推荐这个插件用于任何开发环境,因为它对于在正在运行的服务器中运行特殊代码非常有用 要重新运行引导initclose,请浏览http://localhost:8080/appname/console。在控制台中输入以下内容: def servletCtx = org.codehaus.groovy.grails.web.context.ServletContextHolde

Grails中有没有一种方法可以在BootStrap.groovy的内容被更改后运行它而不重新启动应用程序

您可以使用。我强烈推荐这个插件用于任何开发环境,因为它对于在正在运行的服务器中运行特殊代码非常有用

要重新运行引导
init
close,请浏览
http://localhost:8080/appname/console
。在控制台中输入以下内容:

def servletCtx = org.codehaus.groovy.grails.web.context.ServletContextHolder.servletContext
def myBootstrapArtefact = grailsApplication.getArtefacts('Bootstrap')[-1]
myBootstrapArtefact.referenceInstance.init(servletCtx)

如果您在init闭包中定义了环境,那么如何运行此程序?