是否可以在BootStrap.groovy文件中添加资源(初始关闭)?
class BootStrap {
def init = { servletContext ->
modules = {
'test2' {
resource url:[file: 'js/myapp/r2.js']
}
}
}
def destroy = {
// nothing to do
}
}
最终,我想做的是在已有的Groovy文件中为模块添加资源。例如myresource.groovy看起来像这样:
modules = {
'test1' {
resource url:[file: 'js/myapp/rs1.js']
}
'test2' {
resource url:[file: 'js/myapp/rs1.js']
#add more resources here through code
}
}