【发布时间】:2011-02-04 09:02:27
【问题描述】:
我遇到了这个错误:
groovy.lang.MissingPropertyException: 没有这样的属性:类日志: org.utils.MyClass
这是课程的内容:
package org.utils
class MyClass {
int organizationCount = 0
public int getOrganizationCount(){
log.debug "There are ${organizationCount} organization(s) found."
return organizationCount
}
}
我需要添加导入语句吗?我需要添加什么?请注意,该类位于 src/groovy/org/utils 中。我知道在控制器、服务等中可以访问“日志”变量。在“src”类中不确定。
谢谢。
【问题讨论】: