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

前端 未结 10 1677
一向
一向 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:07

    AAh. Whereas with MessageFormat, I can do

    Dear {0}. Your order will be dispatched on {1,date,EEE dd MMM yyyy}
    

    where parameter #1 is a Date object and it gets formatted according to the pattern, there is no equivalent in EL.

    In JSP, I would have used, perhaps, a format tag. In this standalone example, I am going to have to format the Date as a String in my code prior to evaluating the expression.

提交回复
热议问题