Syntax check for Annotations with Spring Expression Language
See original GitHub issueAnnotations like e.g. @Cacheable
, @EventListener
or @PreAuthorize
take a String literal containing logic in form of SpEL. In general this is error prone since there is no compile-time check.
It would be nice to be warned earlier that the expression is erroneous. It seems this is a feature of IntelliJ:
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (5 by maintainers)
Top Results From Across the Web
8. Spring Expression Language (SpEL)
The Spring Expression Language (SpEL for short) is a powerful expression language that supports querying and manipulating an object graph at runtime.
Read more >Spring Expression Language Guide - Baeldung
The Spring Expression Language (SpEL) is a powerful expression language that supports querying and manipulating an object graph at runtime.
Read more >Spring SpEL - Quick Guide - Tutorialspoint
The Spring Expression Language, SpEL is a very powerful expression language and it supports querying and manipulating an object graph at runtime. It...
Read more >Spring Expression Language - a Spring 3 Feature You May ...
The Syntax. First off, SpEL can be used in both XML and annotation metadata (also known as Spring configuration or wiring). In either...
Read more >Spring Expression Language (SpEL) Example
Spring Expression Language is passed in #{ <expression string> } format in both cases, annotation configuration as well as XML configuration. In ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As mentioned, there is a basic check for the syntax of the SpEL expression in place now. It works across Java annotations as well as Spring XML config files. It does not yet take the
@AliasFor
information into account, that is something for future work in this area.Nevertheless, I mark this issue as resolved and will deliver this as part of the upcoming Spring Tools 4.7.1 update.
This would indeed be a super awesome enhancement for the Spring Tools 4. I will definitely put this on the list of things we should take a look at for future releases.