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

866 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,431
  • 1
  • 24
  • 40
0
votes
1 answer

. character in bean name and use at SpEL

I have a simple spring context file as following:
Sam
  • 6,106
  • 6
  • 42
  • 78
0
votes
2 answers

Spring PropertyPlaceholderConfigurer in Linux

Config in applicationContext.xml:
Varun Achar
  • 13,274
  • 7
  • 53
  • 71
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
  • 3,952
  • 6
  • 39
  • 56
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
  • 59,060
  • 84
  • 230
  • 322
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
  • 2,706
  • 4
  • 26
  • 43
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.
  • 647
  • 1
  • 8
  • 26
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,301
  • 9
  • 51
  • 83
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:
EngineerBetter_DJ
  • 11,630
  • 15
  • 81
  • 158
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
  • 15,091
  • 64
  • 201
  • 364
0
votes
1 answer

Spring MVC controller JUnit: failed to load application context

@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration({"/web-application-config.xml"}) My project consist of 4 modules/layers. I can't make these annotations work with my JUnit test for Spring MVC controller but in other layers, it works…
-1
votes
1 answer

ternary operator in SpEL Spring

I have the following expression:
Andrew
  • 394
  • 3
  • 14
-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 2 3
57
58