According to this answer, I set up JSF on Spring Boot. The problem is, that the embedded Tomcat does not scan the @ManagedBean annotations at startup.
For testing, I placed this ManagedBean:
@javax.faces.bean.ManagedBean(eager = true)
@javax.faces.bean.ApplicationScoped
public class TestController {
public TestController() {
System.out.println("Eager ManagedBean!");
}
}
The JSF servlet is initialized correctly (and eagerly) at startup, but the sout text is not printed:
INFO [config] - Mojarra 2.2.13 für Kontext '' wird initialisiert.
INFO [PostConstructApplicationEventListener] - Running on PrimeFaces 6.0
INFO [config]- Monitoring file:/src/main/webapp/WEB-INF/faces-config.xml for modifications
I have also placed a faces-config.xml in WEB-INF, having 'metadata-complete=false'.
I think it might have something to do with the way the embedded Tomcat is configured, maybe Tld scan? I did not change the Spring Boot default Tomcat.
Can someone tell me how to enable annotation scanning in embedded Tomcat 8?