I am trying @javax.naming.Inject a Spring 3 Bean called WtvrBean in JSF 2 @FacesConverter .
Both Bean and Converter are in the same package. And, in my Spring applicationContext.xml, I am looking at this package:
<context:component-scan base-package="my-package" />
But that does not work. Of course, the inner JSF 2 class that uses the converter is definitely not in my-package .
For example, if I @ManagedBean from JSF 2 ManagedBean and replace it with @org.springframework.stereotype.Component or @Controller , WtvrBean could be @Inject ed on that ManagedBean using Spring WebFlow.
Well, as far as I know, Spring doesn't have the @Converter stereotype.
I know I can use
FacesContextUtils.getWebApplicationContext(context).getBean("WtvrBean")
But with this approach, the connection between the web application and Spring becomes more stringent. (annotations are metadata and are not even considered by some authors dependent).
I am using FacesContextUtils so far if there is no better solution.
Any ideas?
bluefoot
source share