[
https://issues.apache.org/jira/browse/JEXL-177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14709313#comment-14709313
]
Dmitri Blinov commented on JEXL-177:
------------------------------------
I see it as unified expressions are linear by their nature, suppose I want part
of XML
{code}
<package>${item}</package>
{code}
to be shown if item contains value and not to be shown when it's empty. So I
have to provide the following
{code}
${not empty (item) ? "<package>" : ""}${item}${not empty (item) ? "</package>"
: ""}
{code}
Just imagine how things whould be complicated should we "enhance" it with some
"elseif/else" logic...
So I think advanced templating by itself is a serious challenge, as an example,
see how template engines like freemarker provide a directive to this
{code}
<#if item != null>
<package>${item}</package>
</#if>
{code}
but for me this "JSP/JSTL" style where structural programming is embedded in
forms of directives or tags into templates is an opposite to what I'm inclining
to in terms of overall efficiency and design.
> Unified expressions to be used in String literals in Jexl scripts
> -----------------------------------------------------------------
>
> Key: JEXL-177
> URL: https://issues.apache.org/jira/browse/JEXL-177
> Project: Commons JEXL
> Issue Type: New Feature
> Affects Versions: 3.0
> Reporter: Dmitri Blinov
> Priority: Minor
>
> Introduce new string literals to jexl script that allow unified expressions
> to be used, string literals could use for example triple quoted (single or
> double) syntax for delimiters, may include newlines and should not escape
> single quotes
> {code}
> user = "Bob"; server = "Test"; s = """Hello ${user}, welcome to ${server}""";
> return s;
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)