我正在尝试了解如何使用从服务调用的 ApplicationTagLib 中的 createLink 创建链接。
圣杯: 3.2.8
代码 :
def applicationTag = new ApplicationTagLib()
def abc = application.Tag.createLink(controller:"accomodate", action:"menu", id:4)
Run Code Online (Sandbox Code Playgroud)
错误 :
org.grails.taglib.GrailsTagException:标签 [createLink] 不存在。没有找到对应的标签库。
我对这个版本很新。如果您帮助我找出我的代码存在什么样的错误,我将非常感激。
我正在尝试将值从控制器传递到 gsp。页面中不显示任何内容。
索引.gsp
<html>
<head>
</head>
<body>
<h1>"${greeting}"</h1>
<h1>${greeting}</h1>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
控制器:
def index = {
render(template:'index',model: [greeting:test])
}
Run Code Online (Sandbox Code Playgroud)
谢谢普贾
grails ×2