非servlet JSP
我意识到有 EL 和近 EL 框架,如 StringTemplate、JUEL、Velocity 等。 不过,我并不是要求提供 JSTL/EL 的替代品列表。
一年多前,我遇到了一个包,有人编写了一个 util 来模拟非 servlet env 的 JSP 功能,即不需要“servlet 容器”即可运行的 JSP 组合。
我忽略了它,现在我认为这对我有帮助,我需要帮助来回忆它是什么。
我的实际动机类似于 StringTemplate、JUEL、Velocity 会提供帮助我编写 SQL 块、HTML 块,但我认为 JSP 被预编译为字节码,并且 JSP 的运行时效率更高,因为不再进行运行时解析比一次。
因此实际上,只要模板被预编译成字节码,替代方案的推荐就是可以接受的。但我还是更喜欢JSP模拟器。
I realise there are EL and near EL frameworks like StringTemplate, JUEL, Velocity, etc.
However, I am not asking for list of alternatives to JSTL/EL.
I came across a package more than a year ago, someone who wrote a util that emulates the functionality of JSP for non-servlet env, i.e., JSP composition which does not need a "servlet container" to function.
I ignored it and now I think it would be helpful to me and I need help to recall what it is.
My actual motivation is similar to what StringTemplate, JUEL, Velocity would offer to help me compose SQL blocks, HTML blocks but I am thinking that JSPs are precompiled into bytecode and JSPs are more run-time efficient since run-time parsing is done no more than once.
So actually, recommendation for alternatives would be acceptable as long as the templates are precompiled into bytecode. But I still prefer the JSP emulator.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Freemarker 模板引擎是 jsp 的一个很好的替代品。作为独立的它非常出色,而且您还可以看到它如何集成到 struts 2框架。当与 OGNL 堆栈结合使用时,它完全替代了 jsps。
A great replacement to jsps is the Freemarker templating engine. It is excellent as a stand-alone, but also, you can see how it is integrated to struts 2 framework. When combined with the OGNL stack, it is a complete replacement to jsps.