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
1 answer

How can I genneration a groovy script loaction by using the payload or header

I want to use the groovy script, but I want to generate the property location by using the value in the headers How can I achieve this? location="#{scriptService.getScriptLoacation(#headers['location'])}"
a95473004
  • 41
  • 4
0
votes
2 answers

Expression in annotation using fields of class in Spring Security

I use method level security. In class I annotated some methods, expressions use fields of this class. But I see SpEL exceptions, that I can't reference them. Here is part of code of this class. In expressions I want to use field repPrefix, but I…
Alex
  • 91
  • 1
  • 8
0
votes
1 answer

What exactly do the following SpEL expression?

I have some doubt about what exactly do these 3 Spring SpEL example: 1) FIRST EXAMPLE: It seems to…
AndreaNobili
  • 40,955
  • 107
  • 324
  • 596
0
votes
1 answer

Spring 4 SPEL null injection

I have a spring bean in which I want to optional. I tried something like this:
YaOg
  • 1,748
  • 5
  • 24
  • 43
0
votes
1 answer

SpEL getMethod don't work

suppose I have a class foo.PoJo which has a static public method String, according to the offical reference,this piece of code should return a Method instance. SpelExpressionParser parser = new SpelExpressionParser(); Expression exp =…
Jade Tang
  • 321
  • 4
  • 23
0
votes
1 answer

Set bean property from xpath payload

I trying make like this: but it doesn`t work. Also, I am trying this:
0
votes
0 answers

Use of SpEL in context configuration

I am trying to conditionally import a bean configuration file based on the value of the protocol component url property, specifically, for the HTTPS URL I would like to import ws-https.xml file, otherwise I'd like to import ws-http.xtml…
PassoGiau
  • 587
  • 2
  • 7
  • 18
0
votes
2 answers

Using Spring Integration SpEl inside value tag

I am trying to set the properties file inside a class that extends the PropertyPlaceholderConfigurer based upon the environment (local, dev, ref, qa, prod) My folder structure looks like the following. properties environment.properties …
0
votes
1 answer

Spring security different roles DTAP

We currently have different roles in our environments, for example in development we have roles called USR and ADM, while in production they use full names for example USER, ADMIN and ADMINISTRATOR. My idea to resolve this problem is to use a…
g00glen00b
  • 41,995
  • 13
  • 95
  • 133
0
votes
0 answers

SPEL - Pound Sign in Expression

I have a pound sign in a string (hex color code) that I do not want the parser to attempt to evaluate: #542582 Is there a way to either escape these, or better yet, configure the parser to somehow ignore based on a pattern that matches this?
Steve
  • 53,375
  • 33
  • 96
  • 141
0
votes
2 answers

Unable to get values after decimal after evaluating spring expressions

I am trying to do a following thing: String value = "10/3"; ExpressionParser parser = new SpelExpressionParser(); final Expression expression = parser.parseExpression(value); System.out.println("value1:…
Shaan
  • 31
  • 6
0
votes
1 answer

Spring.NET how to set value of dictionary entry using SpEL

I'm having an issue setting a dictionary entry value using Spring.NET Expression Language in XML configuration. I have a PreferencesManager class that has a Dictionary property that I want to configure via XML. One of the entries in…
Lee Fowler
  • 61
  • 12
0
votes
1 answer

Spel - is it possible to declare a new TokenKind value

Spring Spel supports the following set of the TokenKind elements. package org.springframework.expression.spel.standard; /** * @author Andy Clement * @since 3.0 */ enum TokenKind { // ordered by priority - operands first LITERAL_INT,…
emeraldjava
  • 10,894
  • 26
  • 97
  • 170
0
votes
3 answers

Spring StandardTypeLocator in StandardEvaluationContext: registering new import prefixes for use in Thymeleaf templates

We are developing a Spring MVC (v4) web app using the Thymeleaf templating library in the view layer with the Thymeleaf SpringTemplateEngine providing SPEL support. When we reference types in our templates (e.g. for access to static utility methods…
Tom Bunting
  • 1,845
  • 16
  • 24
0
votes
1 answer

Spring SpEL Wiring Collection

I was reading Spring in action these days and came across the following code. I'm wondering if the following code can actually work. It seems like…
Yan
  • 153
  • 3
  • 12