English 中文(简体)
是否有人使用模板引擎成功使用嵌入模式( 不是服务器封口, 而是独立灰熊实例) 使用新泽西?
原标题:Does anybody use Jersey in embedded mode(not servlet env but standalone Grizzly instance) successfully with a template engine?

雄性、自由标志、Japid、Rythm,任何其他?我所寻找的解决方案类似于JSP在服务器环境中提供的解决方案。它应该是一种视图处理程序执行形式,但应致力于独立嵌入的灰熊部署(NIO 架构)。

最佳回答

泽西岛支持免费标志模板 - 见 "http://search.maven.org/#search%7Cga%7C1%7Ca%3a%22jersey-freemarker%22" rel=“nofollow”>>jersey-freemarker模块 。它与任何容器(即不取决于服务器)一起工作。泽西岛工作空间也有免费标志样本显示如何使用它 - 见

问题回答

我认为所有您列出的模板引擎都可以在独立环境下使用。 具体来说, Rythm (因为我是这些产品的作者), 它从不同来源上载模板文件 :

  1. 从所提供的字符串内容 :

    string 结果 = Rythm.render ("hello@who","world");

  2. rythm. root 设置所找到的文件 :

    string 结果 = Rythm.render (“ helloWorld.html ”, “world” );

  3. 如果您没有 ryethm. root 设置, 从类路径中找到的文件

它并不取决于任何服务器容器, 所以只要您有 JRE, 您就可以自由使用它。 如果您想要在不允许文件写入的 GAE 中使用 < code> true , 请务必将 < code> true 设置为 < code> true

开放源码项目

http://www.bitplan.com/index.php/SempleRest" rel=“不跟随 nofollow noreferrerr>>http://www.bitplan.com/index.php/SpleRest

a 提供模板资源基级,该基级将完成大部分“重升”工作,使泽西、格里兹利和Rythm模板引擎能够很好地一起工作。





相关问题
NHibernate L2 Cache configuration in Fluent NHibernate

Is ti possible to configure the L2 cache provider in code via FHN? Adding a line to the following config is what I m after: return Fluently.Configure() .Database(MsSqlConfiguration....

velocity framework on google app engine

i am trying to use velocity framework on google app engine. i wrote a small program with a main method and tried running it locally. i get the following exception : Exception in thread "main" org....

Apache Velocity $ vs $!{}

For apache velocity, is there a difference between accessing variables with $ vs. $!{}. If so, what is it?

Velocity (VM) template: how to disable for a block of jquery

I have Apache Velocity. I have some jQuery code. I think VM doesn t like when I do things like $img.css("float","left"). How can I completely disable VM parsing within a block of HTML/Javascript ? ...

Spring MVC: Resolving the view based on User-Agent

Spring Version: 2.5.6 I want to resolve the view to a specific velocity file based on the value of the User-Agent header. My current line of thinking is an implementation similar to the ...

Encoding problems with Apache Velocity include

I have a velocity/html file. I m trying to include/parse some simple HTML into a page. If I just copy the text directly on the the main file, it works fine: Miranda Kerr hasn’t been a Victoria’s ...

热门标签