Grails插件MyBatis的gateway问题
Grails插件MyBaits使用时命令 grails create-gateway Client会生成两个文件 client.xml和ClientGateway.groovy,但是这个Gateway不能通过在一个controller或者services里面写属性的形式注入,例如属性写成
clientGateway
for (a in application.getArtefacts(GatewayArtefactHandler.TYPE)) { log.debug "Found gateway artifact $a of type ${a.clazz}; will register as ${a.shortName}" if (a) { def shortName = a.shortName[0].toLowerCase() + a.shortName[1..-1]; //添加此行 "${shortName}"(a.clazz) { bean -> bean.singleton = true bean.autowire = "byName" } } }