Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [el-dev] Question about the new OptionalELResolver


I've been following this discussion here, and recognize the importance of the current concerns.

We do have to remember that we have really little time remaining to resolve this. _expression_ Language is up for review at the end of this month:


Kind regards,
Arjan Tijms

On Tue, 20 Feb 2024 at 12:43, Mark Thomas via el-dev <el-dev@xxxxxxxxxxx> wrote:
On 13/02/2024 15:31, Paul Nicolucci wrote:
> Hey Mark,
> Your proposal seems reasonable to me!

I've started to look at implementing this in Tomcat and have found a
complication. Consider the following _expression_:

${ ->}

Should this call which is likely what was intended or
should it call Optional.get().map() which will probably throw a

I think the answer is that the user has to choose.

Choice A: Don't use OptionalELResolver

Instances of Optional are treated like any other object. The _expression_
above will trigger a call to and return a (possibly
non-empty) Optional.

Choice B: Use OptionalELResolver

Instances of Optional are treated as Optional.get() if present and null
if empty (and any property or method on the Optional is ignored). The
_expression_ above will return null if the Optional is empty. If the
Optional is present then the _expression_ will return the result of
calling Optional.get().map() which may return a value or may throw a

I'm going to continue my work in Tomcat on this basis and see where
things end up.

el-dev mailing list
To unsubscribe from this list, visit

Back to the top