jakartaee / expression-language

Jakarta Expression Language
https://eclipse.org/ee4j/el
Other
68 stars 49 forks source link

Add Elvis Operator to Simplfy Null Handling #243

Open hantsy opened 1 month ago

hantsy commented 1 month ago

eg. if email is null, returns Not Found instead, else returns email property.

customer.email?:'Not Found'
markt-asf commented 3 weeks ago

I have an implementation of this in the current Tomcat 12 development branch. You can download SNAPSHOT build a standard distribution from: https://repository.apache.org/content/groups/snapshots/org/apache/tomcat/tomcat/12.0.0-M1-SNAPSHOT/

Embedded and individual JARs are also available.

If you could try that and and confirm whether or not it works for you that would be great. I can then work on the changes required to the specification document and some TCK tests.