将数据输入 GSP
我有一个在另一个 GSP 内呈现的模板。我似乎找不到将数据填充到其中的方法。这是我的学生班级/控制器的生成显示页面。因此,学生控制器应该处理“显示”功能,但它永远不会进入该功能。 有没有办法从学生表中获取数据并填充studentInstance.id、studentInstance.Name等?
另外,有没有真正解释普惠制的好书/网站。我找不到任何对更复杂的操作有真正好的参考的内容。
谢谢
I have a template that is rendered inside another GSP. I can't seem to find a way to populate the data into it. It is a generate show page of my students class/controller. So the student controller should process the 'show' function, however it is never getting into that function.
Is there a way to get the data from the student table and populate the studentInstance.id, studentInstance.Name, etc?
Additionally, are there any good books/ websites that really explain GSP. I can't find any that have really good references to the more complex actions.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在 Grails 用户指南,更具体地说是在 Web 层部分。
You can find all the information you need about Controllers, GSPs and templates in the Grails user guide, more specifically in the Web Layer section.
要将数据传递到模板中,请使用
model
参数。这是我从一些代码中抓取的一个示例:至于文档,几乎所有内容都可用 此处。但我发现《Grails in Action》也是一本很有帮助的读物。
To pass data into a template, use the
model
parameter. Here's an example I grabbed out of some of my code:As for documentation, pretty much everything is available here. But I've found Grails in Action to be a helpful read in addition.