在grails 2.2.1 controller.metaClass.renderForBrand()中没有获取视图和模板名称.. 这是代码:
controller.metaClass.renderForBrand = { Map args ->
def viewName = args.view
def templateName = args.template
def controllerName = args.controller ?: groovyPagesUriService.getLogicalControllerName(delegate)
if(args.view || args.template){
//add the following info to model to display: brand, delegate controller, gsp name, instanceid, and environment (only for gsps)
def instanceId = System.getProperty("com.j2.property.instanceid")
def environment = Environment.getCurrent()
def gsp = args.view ?: args.template
def model = args.model ?: [:]
model.debugInfo = [instanceId:instanceId, environment:environment, gsp:gsp, delegateController:controllerName]
args.model = model
}
originalRenderMethod.invoke(delegate, args)
}
这里控制器没有进入地图的侧循环而没有获取视图名称和模板名称。