Questions tagged [spring-expression]
8 questions
2
votes
3 answers
How to add an object without a constructor to a list using Spring Expression Language
I want to add a BigDecimal to a list using Spring Expression Language.
public class SpelTest {
public List values;
StandardEvaluationContext context;
SpelExpressionParser parser;
@Before
public void setup() {
…

MartinKnopf
- 105
- 1
- 8
2
votes
1 answer
Filter integer list in Thymeleaf
I am learning about Thymeleaf in Spring, and I am struggling with list fitlering.
The official Tutorial: Using Thymeleaf does not talk about collection filtering and projection, but I found out that Thymeleaf on Spring uses the Spring Expression…

Markus Weninger
- 11,931
- 7
- 64
- 137
1
vote
1 answer
To use expression language to get values
My expression is :#age*10 And I assigned a value of 15.6 to age
The result of this is 156.0 In fact the final result I want to get is:156
I can do it in the code, but how to do it by modifying the expression.
thanks

James
- 85
- 8
1
vote
0 answers
SpEL expression fails to evaluate on second String literal value processing when in SpelCompilerMode.IMMEDIATE mode
Using spring-expression version 5.1.5, trying to evaluate several values using pre-compiled SpEL expression, like in the following snippet:
String expression = "T(java.time.LocalDateTime).parse(#root,…

Sergey Shcherbakov
- 4,534
- 4
- 40
- 65
0
votes
1 answer
How to use user ID as parameter for custom authentication annotation?
I've a REST API:
@CurrentUserAccessLevel(userId = "#studentId")
@GetMapping(value = "/{course-code}/users/{student-id}")
public UserCourseDetailsDto getUserCourseDetails(@PathVariable(value = "course-code") final Long courseCode,
…

yaroslav96
- 33
- 4
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
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
1 answer
What is %some property% expression in spring
I found %% expression on spring batch source.
Is this SpEL? How do I use %% expression?
protected String getQuery(String base) {
return StringUtils.replace(base, "%PREFIX%", tablePrefix);
}
enter image description here
enter image description…

Jason Moon
- 11
- 3