applicationScoped Bean을 주입하려고합니다. 그것이 작동하지 않는 두 개의 오버 플로우 스레드의 주사와Java Inject Applicationscope Bean
FacesContext context = FacesContext.getCurrentInstance();
WebsiteController websitesController = context.getApplication().evaluateExpressionGet(context, "#{websitesController}", WebsitesController.class);
: 나는 모든 (WebsitesController이 AppScoped입니다) 괜찮 얼굴 맥락에서 JSF 방식으로 JSF2 ApplicationScope bean instantiation time? 및 Get JSF managed bean by name in any Servlet related class
에서 유사한 주제를 발견 . 내 코드 :
@ManagedBean(eager=true)
@ApplicationScoped
public class WebsitesController implements Serializable {
...}
지금은 내가 다음 문 노력
@ManagedBean(name = "shopController")
@ViewScoped
public class ShopController {
{Injection-Statement}
private WebsitesController websitesController;
을 시도 :
@ManagedProperty("#{websitesController}")
@Inject
@EJB
무슨 내 잘못?