I have some variables in JSF managedbean with different scopes (that I feel). In the following snippet, userTable is used in both login() and register() method. But roleList is used only in register() method.
userTable should be in session scope, since it should be accessable during user session.
And I feel like roleList should not be in session scope, since it will be populated in a combo box during registration page only. I guess request scope is enough.
But how can I put roleList in requestScope since UserManagedBean is in session scope already.
Thanks much for any advice.
@Named("user")
@Scope("session")
public class UserManagedBean implements Serializable {
private UserTable userTable = new UserTable();
private List roleList = new ArrayList();
public String login() {
// login process here
}
public String register() {
// register user here
}