String getLogicalControllerName(GroovyObject controller) { ServletRequest request = null; try { request = (ServletRequest) controller.getProperty(ControllerDynamicMethods.REQUEST_PROPERTY); } catch (MissingPropertyException mpe) { // ignore } String logicalName = request != null ? (String) request.getAttribute(GrailsApplicationAttributes.CONTROLLER_NAME_ATTRIBUTE) : null; if (logicalName == null) { logicalName = GrailsNameUtils.getLogicalPropertyName( controller.getClass().getName(), ControllerArtefactHandler.TYPE); } return logicalName; }
private String getControllerName(Object target, Map argMap) { return argMap.containsKey(ARGUMENT_CONTROLLER) ? argMap.get(ARGUMENT_CONTROLLER).toString() : GrailsNameUtils.getLogicalPropertyName( target.getClass().getName(), ControllerArtefactHandler.TYPE); }