是否有类似 JSP 的基于 Java 的 Web 模板引擎可以从持久存储中加载页面模板?
我想提供用户为我的应用程序编写插件,最初的设计和实现涉及 Velocity (VTL)模板引擎允许
- 安全:用户无法调用内部Java代码(无需使用反射进行黑客攻击)
- 简单:有限且受限的API,我可以编写我自己的领域特定语言
- 可移植:我可以将VTL模板存储在JAR、数据库或我喜欢的任何地方
- 解耦:模板上下文和逻辑/控制器不耦合web / HTML
然后是 VTL 的 限制(首先不支持标签库) )我们查看了 Freemarker
它具有所有优点,但我想知道这是不是 其他替代方案是 eclipse JET,目前
我不知道还有什么其他选择,
我想要一个可以具有 Java 内容辅助(如 JSP)的解决方案,但这可以是保存在数据库中
有类似的东西吗? (除了 JET 和 JBoss 的 Freemarker buggy 插件)
I would like to provide users to write plugins to my application, the initial design and implementaion involve a Velocity (VTL) template engine to allow
- Secure: uesrs can't call internall Java code (without hacking using reflection)
- Simple: Limited and confined API, I can write my own domain specific language
- Portable: I can store VTL templates in a JAR, in the database or anywhere I like
- Decoupled: template context and logic / controller is not coupled to the web / HTML
Then with the limitations of VTL (no tag library support as first) we looked at Freemarker
It has all the advantages, but I wonder if this is as good as it gets
The other alternatives are eclipse JET, and I don't know of anything else at the moment
I would like a solution that can have Java content assist (like JSP) but that can be saved in the database
Is there something like this out there? (Besides JET, and JBoss's Freemarker buggy plugin)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看Thymeleaf。
我还没用过它..还没有!
开发人员设计它似乎是为了解决 Velocity 和 FreeMaker 的缺点。
Check out Thymeleaf.
I haven't used it.. YET!
It appears the developer designed it to address the shortcomings of Velocity and FreeMaker.
我已经在多个项目中成功使用了 FreeMarker。
为了解决您的问题:
至于内容辅助,大多数主要 IDE(IntelliJ、Eclipse,可能还有 NetBeans)都支持 FreeMarker 语法,并且应该提供关键字自动完成功能。如果您想要一个基于 JavaScript 的 FreeMarker 编辑器,我并不那么肯定,因为我不知道。
祝你好运!
I have successfully used FreeMarker on several projects.
To address your concerns:
As for content assist, most major IDE's (IntelliJ, Eclipse, probably NetBeans) have support for the FreeMarker syntax and should provide auto-completion for the keywords. If you want a JavaScript-based editor for FreeMarker, I'm not as affirmative since I know of none.
Good luck!