Playframework - GSP 和标签库?
是否可以在 Play 中使用 Grails GSP 引擎作为模板引擎?
包括 TagLibraries
等?`
要使这些东西发挥作用,需要什么?
(我更喜欢 HTML 样式标签而不是 Ruby 样式(丑陋烦人)
Is it possible to use the Grails GSP engine as the template engine in Play?
Including TagLibraries
and such?`
What is neccessary to make that stuff work?
( I prefer the HTML style tags over the Ruby style ( ugly annoying )
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
模板引擎是一个可插入的系统。例如,在 Play 1.0 中已经有了开箱即用的 Groovy 引擎、Scala 模块中的 Scala 引擎、Cambridge 和 Japid 引擎,也可以作为插件使用。
对于 Play 2.0,已经有 Scala 引擎和 Groovy 引擎的实现(我相信打算成为一个插件)。
为了回答你的问题是否可以做到,上面清楚地表明这是可能的,正如其他人所做的类似的那样。要回答什么是必要的,这取决于您的目标平台(Play 1 或 Play 2),但是您可以遵循这两个示例来创建自己的模块。我想强调的是,Play 2.0 还不是一个稳定的版本,因此请保持谨慎,并为下个月左右的某些事情发生变化做好准备,直到发布最终版本。
The template engine is a pluggable system. For example, in Play 1.0 there is already the out of the box Groovy engine, the Scala engine within the Scala module, the Cambridge and Japid engines, also available as plugins.
For Play 2.0, there is already the Scala engine, and an implementation of the Groovy engine (I believe intended to be a plugin).
To answer your question of can it be done, the above clearly shows that it is possible, as others have done similar. To answer what is necessary, it depends on which platform you are targetting (Play 1 or 2), but there exists examples of both that you can follow to create your own module. I would highlight that Play 2.0 is not a stable release yet, so be cautious and prepare for some things to change over the next month or so, until a final release is issued.