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
0
votes
2 answers

Spring Expression Language equivalent for \r, \n, \t etc

I am using Spring Integration. I get a string (payload) like below: 5 I need to test if above string starts with which is actually \r\n…
Suvasis
  • 1,451
  • 4
  • 24
  • 42
0
votes
1 answer

. character in bean name and use at SpEL

I have a simple spring context file as following:
Sam
  • 6,770
  • 7
  • 50
  • 91
0
votes
2 answers

Spring PropertyPlaceholderConfigurer in Linux

Config in applicationContext.xml:
Varun Achar
  • 14,781
  • 7
  • 57
  • 74
0
votes
1 answer

Inject spring bean in custom el functions

i want to create a custom el functions to get in a fast way select options from dao. I'm using Spring and i want to inject spring bean dao in my custom el functions class. In el functions class i'm using static methods and i'm unable to access…
Premier
  • 4,160
  • 6
  • 44
  • 58
0
votes
1 answer

Is there a way to calculate property value by means of Spring?

I have a dataSource bean. I need to extract a boolean value from it: dataSource.getConnection().getMetaData().supportsStoredProcedures() and then use it inside my DAO to define behavior. The obvious way to get this value is to inject dataSource…
Roman
  • 64,384
  • 92
  • 238
  • 332
0
votes
1 answer

Spel Expressions | @CacheEvict | applicationContext

I am using caching annotations of Spring. I want to pass name of Cache [@CacheEvict(name="vendorCache")] from applicationContextfile or it can be configured in any other way. Now i have scenario in which i have two classes VendorDAo and…
0
votes
1 answer

Is it possible to use Spring EL when referencing a bean in constructor-arg?

I get the following error: Cannot resolve reference…
Nimrod Dayan
  • 3,050
  • 4
  • 29
  • 45
0
votes
1 answer

Implicit conversion from int[] to double[]

I have two functions public static double avg(int[] values) { if(values == null || values.length == 0) return -1; double sum = 0; for(int value:values) { sum = sum + value; } return (sum/values.length); } public static…
Here to Learn.
  • 677
  • 2
  • 10
  • 31
0
votes
1 answer

Execute some code only when the user navigates to a view from a different view

I have an JSF application that uses Spring Web Flow for navigation. Each time the user navigates to the accounts view from another view a piece of code should be executed. For the accounts view I have a managed bean called accountsBean. I thought of…
Seitaridis
  • 4,459
  • 9
  • 53
  • 85
0
votes
1 answer

Escaping Regex in SpEL

How should I escape the following Java code, so I can use it in a Spring-EL expression? Java: .replaceAll("[\\p{Punct}&&[^\"|\\]|\\[|+|\\-|:|(|)|_|~|.|,|%|?]]", " ") Spring-EL, which doesn't parse:
DeejUK
  • 12,891
  • 19
  • 89
  • 169
0
votes
1 answer

Printing a request scoped parameter using jstl

I have 2 jsps. jsp1 goes to a portlet and portlet redirects to jsp2. jsp1 has a 'Finish' button that triggers the flow. jsp1 has also some other buttons. In jsp1, I have: in…
Victor
  • 16,609
  • 71
  • 229
  • 409
-1
votes
1 answer

Spring SpEl - Identify which part of an expression to trigger the rule

Is there a way to identify which part of a SpEL expression trigger a rule ? For example : a < 10 || a > 20 I want to know if the rule is fired because a < 10 or a > 20 For example : ExpressionParser parser = new SpelExpressionParser(); Expression…
marojbor
  • 191
  • 10
-1
votes
1 answer

Reactive Spring Security: using custom reactive method in @PreAuthorize Spring-EL

Is there any way to use reactive method in @PreAuthorize? [environment] spring boot 3.0.1 language: kotlin @EnableWebFluxSecurity @EnableReactiveMethodSecurity // My custom method fun role(authentication: Authentication): Boolean { …
unD3R
  • 34
  • 5
-1
votes
1 answer

Spring Framework: Is there a list of "reserved words" or "Predefined Variables" about SpEL?

For Spring Framework where is the complete list of reserved words or Predefined Variables about SpEL with their respective explanation? It such as for: environment systemProperties systemEnvironment For example in this valuable tutorial is just…
Manuel Jordan
  • 15,253
  • 21
  • 95
  • 158
-1
votes
1 answer

ternary operator in SpEL Spring

I have the following expression:
Jelly
  • 972
  • 1
  • 17
  • 40
1 2 3
63
64