Spring Expression Language
When using the ${}
syntax, you are in fact using Spring Expression Language (SpEL). There are several variants of EL available in the wild; SpEl is one of the most powerful variants.
Here is an overview of its main features:
Feature |
Syntax |
Explanation |
---|---|---|
Accessing a list element |
| |
Accessing a map entry |
| |
Ternary operator |
| |
Elvis operator |
|
Returns |
Safe navigation |
|
Returns |
Templating |
|
Injects values into a string |
Projections |
|
Extracts the names of all the persons and puts them into a list |
Selection |
|
Get Spring MVC: Designing Real-World Web Applications now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.