1
插件
class MyService {
String getFrom(){ return 'Service from plugin'}
}
class MyBean {
String getFrom(){ return 'Bean from plugin'}
}
APP
class MyAppBean {
String getFrom(){ return 'Bean from App'}
}
package myappwithmyplugin
class MyAppService {
String getFrom(){ return 'Service from App'}
}
resources.groovy
beans = {
myBean(MyAppBean){}
myService(MyAppService){}
}
控制器
class MyController {
def myBean
def myService
def index() {
println myBean.getFrom()
println myService.getFrom()
}
}
爲什麼一個結果是:
比恩從應用
從插件服務
您正在使用的Grails的版本? – Alidad
Loading Grails 2.2.1 –
結帳這個鏈接也許你有這個問題http://jira.grails.org/browse/GRAILS-10091 – Alidad