Este contenido no está disponible en el idioma seleccionado.

26.2. Injecting Spring beans into Seam components


You can inject a Spring bean into a Seam component instance either by using an EL expression, or by making the Spring bean a Seam component.
The simplest approach is to access the Spring beans with EL.
The Spring DelegatingVariableResolver assists Spring integration with JavaServer Faces (JSF). This VariableResolver uses EL with bean IDs to make Spring beans available to JSF. You will need to add the DelegatingVariableResolver to faces-config.xml:
<application> 
  <variable-resolver> 
    org.springframework.web.jsf.DelegatingVariableResolver 
  </variable-resolver>
</application>
Copy to Clipboard Toggle word wrap
You can then inject Spring beans using @In:
@In("#{bookingService}") 
private BookingService bookingService;
Copy to Clipboard Toggle word wrap
Spring beans are not limited to injection. They can be used wherever EL expressions are used in Seam: process and pageflow definitions, working memory assertions, etc.
Volver arriba
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2025 Red Hat