Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot Jsf primefaces和Spring引导项目组件注入问题_Spring Boot_Jsf - Fatal编程技术网

Spring boot Jsf primefaces和Spring引导项目组件注入问题

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

我有一个工作的JSF和Spring引导应用程序。我想与拥有定制spring scope bean的人交流。应用程序上下文是JSF上下文。当我使用@Autowired注释时,新Bean出现并多次运行@PostConstruct方法,这不是我所期望的

我尝试了比豆子注射更多的方法。
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)无关,请阅读