문제

I have beans

@ManagedBean(name="HistoryBean")
@ApplicationScoped
public class HistoryBean
{...}

@ManagedBean(name="ViewBean")
@ApplicationScoped
public class ViewBean
{
        public void setHistoryBean(HistoryBean historyBean) 
        {this.historyBean = historyBean;}

    @ManagedProperty(value="#{HistoryBean}")
    private HistoryBean historyBean;
}

I want to HistoryBean was created only once, but it creates on each request(?) with clean state. What did I do wrong?

도움이 되었습니까?

해결책

Trouble was in wrong annotation imports. You need to use annotation which are from javax.faces.bean package.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top