JSTL/JSP EL (Expression Language) in a non JSP (standalone) context

前端 未结 10 1638
一向
一向 2020-12-01 08:28

Can anyone recommend a framework for templating/formatting messages in a standalone application along the lines of the JSP EL (Expression Language)?

I would expect t

相关标签:
10条回答
  • 2020-12-01 09:21

    The idea of using EL itself outside of Java EE was advocated by Ed Burns and discussed on The Server Side. Tomcats implementation ships in a separate JAR but I don't know if it can be used outside the server.

    0 讨论(0)
  • 2020-12-01 09:23

    You can just use the Universal Expression Language itself. You need an implementation (but there are a few to choose from). After that, you need to implement three classes: ELResolver, FunctionMapper and VariableMapper.

    This blog post describes how to do it: Java: using EL outside J2EE.

    0 讨论(0)
  • 2020-12-01 09:26

    You might want to look at OGNL which is the kind of library you are after. OGNL can be reasonably powerful, and is the expression language used in the WebWork web framework.

    0 讨论(0)
  • 2020-12-01 09:27

    StringTemplate is a more lightweight alternative to Velocity and Freemarker.

    0 讨论(0)
提交回复
热议问题