JSF login filter, session is null

后端 未结 1 925
鱼传尺愫
鱼传尺愫 2021-01-21 23:41

I\'ve been trying to follow this answer primarily but I always get redirected to my login.xhtml (except for when i log in from the login page) because this...

Ap         


        
相关标签:
1条回答
  • 2021-01-21 23:58

    @SessionScoped is from javax.enterprise.context.SessionScoped

    This one works in combination with CDI @Named only. As you're using JSF @ManagedBean, you should be using the scope annotations from javax.faces.bean package instead.

    import javax.faces.bean.ManagedBean;
    import javax.faces.bean.SessionScoped;
    
    @ManagedBean
    @SessionScoped
    public class AppManager implements Serializable {
    

    Without a valid scope, a JSF managed bean would behave like @RequestScoped which effectively means that it's constructed again and again on every request.

    0 讨论(0)
提交回复
热议问题