如何在没有Grails的情况下创建GSP taglib [英] How to create GSP taglib without Grails
问题描述
我们可以在不使用Grails的情况下使用GSP,只需映射servlet groovy.servlet.TemplateServlet
即可。
TagLibs呢?
这里是关于在Grails中使用TagLibs的文档 - 我们应该只添加类到 grails-app / taglib
文件夹。
是否可以在没有Grails的情况下创建自定义GSP标签?如果可能的话,甚至更重要的问题,它究竟能做什么?
更新:它看起来像有一个单独的Grails插件为它 - https://github.com/houbie/gsp-taglib 。所以这个问题实际上归结为我们可以如何使用这个插件的代码
。解析方案
根据一个独立于Grails的完整GSPs,一个href =http://jira.grails.org/browse/GRAILS-5657 =nofollow> http://jira.grails.org/browse/GRAILS-5657 是(截至2012年9月)未来的一个特征。尽管
已经完成了一些最低版本
We can use GSP without Grails, just mapping servlet groovy.servlet.TemplateServlet
.
And what about TagLibs?
Here are docs about using TagLibs with Grails - we should just add class to grails-app/taglib
folder.
Is it possible to create custom GSP tag without Grails? And if it possible, even more important question, how exactly can it be done?
UPDATE: it looks like there is a separate Grails Plugin for it - https://github.com/houbie/gsp-taglib. So the question actually boils down to how we can use code from this plugin I guess.
According to http://jira.grails.org/browse/GRAILS-5657 full GSPs independent of Grails is (as of September 2012) a feature yet to come. Some minimal versions have been done though
这篇关于如何在没有Grails的情况下创建GSP taglib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!