我创建了自己的标签库。在使用时我得到错误:
java.lang.RuntimeException: org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.grails.commons.DefaultGrailsApplication.isArtefactOfType() is applicable for argument types: (java.lang.String, org.springframework.core.io.FileSystemResource) values: [TagLib, file [D:\domain\grails-app\taglib\ext\domain\DomainTagLib.groovy]]
可能的解决方案:isArtefactOfType(java.lang.String,java.lang.Class),isArtefactOfType(java.lang.String,java.lang.String)
TagLib的来源:
package ext.domain
class DomainTagLib {
def contractorFullReq = {attrs, body ->
def Organization organization = attrs?.organization
out << organization?.shortName
}
}