This was asked in a previous question (http://stackoverflow.com/questions/6043259/auto-instantiate-a-session-bean). I implemented the solution offered by BalusC but it isn't working. This is my code:
@ManagedBean
@SessionScoped
public class UserSessionBean {
AND
@ManagedBean
@ViewScoped
public class ReaderBean implements Serializable {
@ManagedProperty("#{userSessionBean}")
private UserSessionBean userSessionBean;
If I understand BalusC correctly, JSF should auto-instantiate the session bean. In my case I get error saying that ReaderBean cannot be instantiate because no instance of UserSessionBean exists. So how can I get JSF to manage the instantiation for me? Manually instantiating and putting to the session map is supposedly a hack/workaround, so I'd like to avoid it.