Questions tagged [spring-el]

The Spring Expression Language (SpEL for short) is a powerful expression language that supports querying and manipulating an object graph at runtime. The language syntax is similar to Unified EL but offers additional features, most notably method invocation and basic string templating functionality.

Spring Expression Language was introduced in Spring 3.0.x

The Complete reference can be found in the reference documentation.

Guides:

Video tutorial on Spring Framework

Blog:

Related tags

958 questions
-1
votes
1 answer

Spark SPEL Expressions UDF

I'm trying to use SPEL expressions along with a Spark udf (scala). SPEL expressions can be simple math operations or custom functions along with java.lang.Math class. When i run it locally everything works find, but when i build a fat jar and deploy…
-1
votes
1 answer

Access value from .properties file in Spring

I have a file named myProperty.properties id.apple=20 id.banana=30 id.orange=40 name=fruit I want to access this property in a service method using Spring's @Value annotation or ExpressionParser. Method looks like this public int myMethod(String…
-1
votes
1 answer

How to skip PreAuthorize in Java if the SpEL execution fails?

I have protected my API endpoints using some custom SpEL functions. However, since using SpEL in @PreAuthorize can lead to run time errors due to exceptions in constructing the SpEL expression. I would like to make @PreAuthorize return true when an…
-1
votes
1 answer

SpEL language - auto null reference initalization

Please look at example code: public static class MyTestClass { public List booleans = new ArrayList<>(); } public static void main(String[] args) { SpelParserConfiguration config = new SpelParserConfiguration(true, true); …
Thomas Banderas
  • 1,681
  • 1
  • 21
  • 43
-1
votes
3 answers

Spring Boot SpEL and configuration property binding to constant expressions

Using Sprint Boot 2.0.4.RELEASE, I have the following properties class (simplified): @Configuration @EnableConfigurationProperties(MyOtherHierarchicalNonConstantProperties.class) public class AppConfiguration { public static final String…
Snackoverflow
  • 5,332
  • 7
  • 39
  • 69
-1
votes
2 answers

Spring Thymeleaf SPEL - if null not wroking

i have the below code that everything runs fine except the check to see if the value is null. I know the value being returned is null, yet it still doesn't work. I've tried having == null both within and outside the {} to no avail. Maybe it has…
Marios
  • 130
  • 1
  • 13
-1
votes
1 answer

spring expression not evaluating simple relational operator

Why is the following code returning TRUE when it is obviously not TRUE? ExpressionParser parser = new SpelExpressionParser(); Integer s = new Integer(132); EvaluationContext context = new StandardEvaluationContext(); …
vamshi
  • 31
  • 2
-1
votes
1 answer

Spring expression 4.0 jars

What are the jar files I need to use spring expression language in my web app? This web app itself is not based on Spring. I would like to use the 4.0.1 version. Is spring-expression-4.0.1.RELEASE.jar alone enough?
Narasimman V
  • 107
  • 1
  • 1
  • 6
-1
votes
1 answer

Expression evaluated client side or server side?

I have the following Thymeleaf code snippet: