Questions tagged [spring-expression-language]
34 questions
0
votes
0 answers
EL1007E: Property or field cannot be found on null SPEL
I'm trying to run a query:
@Query(value = "SELECT o from ORG o join o.biz bizid "
+ "WHERE ( (:#{#x.id} IS NULL) OR bizid.id) = :#{#x.id} ) "
findBy(SearchObject x);
I get an error:
EL1007E: Property or field 'id' cannot be found on…

sander
- 1,426
- 4
- 19
- 46
0
votes
0 answers
SpEL Parser returning false when it's supposed to return true
I am running below piece of code live and for very few traffic[.025%] ~(500 out of 2 million). The SpEL Parser is behaving wierd and returning response as false where it should return true.
Context Class file
@Getter
@Builder
@ToString
public class…

Prashant Chauhan
- 1
- 1
0
votes
0 answers
is there a mean to specify a URL property directly to inject with XML definition file in Spring DI?
I try to instanciate a bean which has a dependency with another bean with Spring. I have seen examples where the property can be specified in xml tags. With standard ype int, String this works but there is a field with URL type and this does not…

Frederic Peugny
- 1
- 1
0
votes
0 answers
Why the method defination is first checked even after writing @PreAuthorize("") in controller above action method?
I am writing condition in @PreAuthorize() which i want to be checked before execution of controller method, but the method defination is first checked when the request comes to that controller method. Below is the controller…

Utkarsh Pawar
- 1
- 2
0
votes
0 answers
Problem accessing headers in SpEL inside @PreAuthorize
I have a @Controller endpoint which I need to secure with a custom method, defined as a static method in another class, which I load into this project as a dependency (JAR). This is my…

Julio César Estravis
- 229
- 1
- 1
- 7
0
votes
1 answer
java Spel with stream API
I have this string 1|1|1|1 and I want to sum the numbers inside spel statement.
I tried this one but got wrong expression.
T(java.util.Arrays).stream(SERVICE_CLASS.split('|')).reduce(Integer::sum)
the log…

Anas Altarazi
- 97
- 8
0
votes
0 answers
SpEL - Convert Json Objects with list into single list
I'm using Spring Expression Language to manipulate json due application requirements.
I have the following json response:
[
{
"steps": [
{
"id": 000,
"sequence": 4,
"type":…

Paulo Eduardo
- 43
- 2
- 9
0
votes
0 answers
Use configuration properties in Spring expression language
I have a class with configuration properties:
@Data
@ConfigurationProperties("message-starter")
public class JobProperties {
public Duration kafkaSendingPeriod;
public Duration rabbitSendingPeriod;
}
And class that aggregates this…

Kirill Zhurbin
- 51
- 3
0
votes
1 answer
Syntax error when using Spring @ConditionalOnExpression in Kotlin
I import in a Kotlin configuration class the
org.springframework.boot.autoconfigure.condition.ConditionalOnExpression
but I get the error message of An annotation argument must be a compile-time constant from IntelliJ when I use the annotation…

dunfa
- 509
- 1
- 10
- 19
0
votes
1 answer
Configurable transaction timeout: set tx:advice/tx:attributes/tx:method/@timeout using Spring EL
I need a configurable transaction timeout according to Spring profiles. So I would like to set tx:advice/tx:attributes/tx:method/@timeout using Spring EL. It works fine when I do a similar setup for an attribute of a tag in the default (beans)…

Géza
- 481
- 1
- 3
- 13
0
votes
1 answer
JPA SPEL optional List parameter
I have a JPA query with multiple joins and optional parameters , the query works fine if there is no multiple values sent in the status list parameter but if I send multiple values its giving exception as
"Caused by:…

ramkr
- 41
- 4
0
votes
0 answers
Error: Springframework.expression.spel.SpelEvaluationException: EL1011E: Method call: Attempted to call method name() on null context object
i need help
I'm trying to create a filter for a store project, using spring, thymeleaf and bootstrap in which the filter will receive from the Product class the value of the "status" attribute which is an enum, however when using the expression…

Ian França
- 1
- 2
0
votes
0 answers
Selecting cron expression for @Scheduled based on another configuration list property in Spring
The following custom configuration properties exist in my Spring Boot (2.5.4) application:
application.yml
app:
tasks:
- name: A
url: http://server-a
cron-expression: "*/5 * * * * *"
- name: B
url: http://server-b
…

Robert Strauch
- 12,055
- 24
- 120
- 192
0
votes
1 answer
spring data neo4j rest projection returns null when using SpEL expression on nested object
Consider the following output is produced:
Case 1: while retrieving the nested object from neo4j using spring data neo4j interface (projection)
{
"name": "Dhoni",
"currentLocation": {
"city": {
"name": "qwerqwer",
…

CdVr
- 323
- 3
- 15
0
votes
1 answer
How to specify headers-expression in Spring Cloud Data Flow processor "http-request"?
We are trying to pass the basic authentication header when using the SCDF prebuilt processor "http-request" to call an external service. From my understanding, the message http headers are not automatically carried over in making the call, we need…

Wally Liu
- 85
- 7