所以我试图在我的 GSP 中访问一个 groovy 函数。我有
<%@ page import = company.ConstantsFile %>
然后在gsp中我有
I have been in the heating and cooling business for <%daysBetween()%>
还有我的 ConstantsFile.groovy
package company
import static java.util.Calendar.*
class ConstantsFile {
def daysBetween() {
def startDate = Calendar.instance
def m = [:]
m[YEAR] = 2004
m[MONTH] = "JUNE"
m[DATE] = 26
startDate.set(m)
def today = Calendar.instance
return today - startDate
}
}
编辑:错误信息:
Class
groovy.lang.MissingMethodException
Message
No signature of method: