Expression support for defining bean definitions:-
SpEL expressions can be used with XML or annotation-based configuration metadata
for defining BeanDefinitions. In both cases the syntax to define the expression
is of the form:
#{<expression string>
Spring EL in XML((XML based configuration):-
The SpEL are enclosed with #{ SpEL expression }, see below example in XML bean
definition file.
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
1 #{empBean} – inject “empBean” into “studBean” bean’s
“name” property.
2 #{empBean.name} – inject “empBean”‘s “name” property into “studBean”
bean’s “studName” property.