Spring boot Jsf primefaces和Spring引导项目组件注入问题
我有一个工作的JSF和Spring引导应用程序。我想与拥有定制spring scope bean的人交流。应用程序上下文是JSF上下文。当我使用@Autowired注释时,新Bean出现并多次运行@PostConstruct方法,这不是我所期望的 我尝试了比豆子注射更多的方法。Spring boot Jsf primefaces和Spring引导项目组件注入问题,spring-boot,jsf,Spring Boot,Jsf,我有一个工作的JSF和Spring引导应用程序。我想与拥有定制spring scope bean的人交流。应用程序上下文是JSF上下文。当我使用@Autowired注释时,新Bean出现并多次运行@PostConstruct方法,这不是我所期望的 我尝试了比豆子注射更多的方法。 facescontextutility.WebApplication(FacesContext.getCurrentInstance.getBean(“myBean”)再次返回新的Bean给我 @Component("f
facescontextutility.WebApplication(FacesContext.getCurrentInstance.getBean(“myBean”)
再次返回新的Bean给我
@Component("facultativeTreatyDefinitionBean")
@Scope("view")
public class FacultativeTreatyDefinitionController {
bean定义
@Component("addressBean")
@Scope("view")
public class AddressController {
@Autowired
@Qualifier("facultativeTreatyDefinitionBean")
private FacultativeTreatyDefinitionController facultativeTreatyDefinitionController;
我的期望是;同一范围内的bean应该在不创建bean的情况下进行通信
您认为问题出在哪里请尝试创建一个自定义范围并将其编辑到您的问题中。然后,您的自定义范围不起作用。如果编码方式不起作用,您的问题与primefaces(或jsf)无关,请阅读