-
如何在Grails的Service中调用createLink
日期:2011-04-25 | 分类:技术
版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
http://gang613.blogbus.com/logs/122869976.html
在Service中调用createLink的可采用以下代码:
def g = new org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib()
//获得绝对link为:http://localhost:8080/projectcontext/site/index
def visitUs = g.createLink(controller: 'site', action: 'index', absolute: 'true')//获得相对link为:/projectcontext/comm/index
def manageSubscriptions = g.createLink(controller: 'comm', action: 'index', absolute: 'true')参考文档:
1)Creating a link in a Grails Service
收藏到:Del.icio.us
<< 在iReport中通过JFreeChart生成雷达图(蜘蛛图) | 首页 | Commons DBCP在OSGI环境中Cannot load JDBC driver class 'com.mysql.jdbc.Driver' 问题解决 >>







