【发布时间】:2009-10-22 13:27:18
【问题描述】:
简单的问题:
我有一个服务类(比如说helpersService)和一个方法def constructURI(params)。
如何从模板视图调用此方法。
我试过下面的代码没有成功
<% def helpersService = new HelpersService() // or def helpersService
%>
<img src="${helpersService. constructURI(params)}"/>
但我得到以下结果:
No signature of method: com.HelpersService. constructURI() is applicable for argument types...
或者(如果我使用def helpersService)
Cannot invoke method constructURI() on null object
有什么想法吗?
【问题讨论】: