...
| Bloc de code |
|---|
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
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
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd" >
...
</beans>
|
| HTML Comment | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Récupération des beansIl est possible de récupérer un bean à partir de son nom à partir du code JAVA. La classe BeanUtils fournie par esup-commons V1 n'est plus utilisée. | |||||||||||||||||||||
| Balise Wiki | |||||||||||||||||||||
| {htmlcomment}
h2. Récupération des _beans_
Il est possible de récupérer un _bean_ à partir de son nom à partir du code JAVA. La classe *BeanUtils* fournie par _esup-commons_ V1 n'est plus utilisée.
On utilise un mécanisme interne à Spring basé sur l'implémentation de * On utilise un mécanisme interne à Spring basé sur l'implémentation de org.springframework.context.ApplicationContextAware * _esup-commons _V2 fournit une telle implémentation qu'il suffit de déclarer dans un fichier de configuration Spring (ex : *properties/applicationContext.xml *) : {
Depuis le code java, on utilisera : {
|