concept SpEL in category spring

appears as: SpEL
Spring Integration in Action

This is an excerpt from Manning's book Spring Integration in Action.

Knowing those properties, you can control the content of downstream messages by using SpEL. Consider the previous logging example. You could add the expression attribute to have more control of the message to be logged:

Now that you’ve seen a number of possibilities enabled by the control bus, let’s take a quick look at an alternative implementation, one that accepts Groovy syntax rather than SpEL in the control message payloads.

Spring Batch in Action

This is an excerpt from Manning's book Spring Batch in Action.

To be able to refer to job parameters, a bean must use the Spring Batch step scope . The step scope means that Spring will create the bean only when the step asks for it and that values will be resolved then (this is the lazy instantiation pattern; the bean isn’t created during the Spring application context’s bootstrapping). To trigger the dynamic evaluation of a value, you must use the #{expression} syntax. The expression must be in SpEL, which is available as of Spring 3.0 (Spring Batch falls back to a less powerful language if you don’t have Spring 3.0 on your class path). The jobParameters variable behaves like a Map. That’s how you refer to the inputResource, targetDirectory, and targetFile job parameters . Note that you’re not limited to plain references; you can also use more complex expressions; for example, notice how the target directory and file are concatenated for the resource property.