This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JSF and the fly likes Question about Session Scoped Bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » JSF
Bookmark "Question about Session Scoped Bean" Watch "Question about Session Scoped Bean" New topic

Question about Session Scoped Bean

Dave Bixler

Joined: Feb 12, 2010
Posts: 4
I have a manged bean that is session scoped as such:

Upon a user pressing a login button, I save the authenticated user in the LoginFormBean. When the next page is displayed, the authenticatedUser is set and displays correctly and the resulting page (which displays correctly) has:

Everything to this point seems to be functioning correctly.

The page where the authenticated user is displayed correctly has several URLs and a form. For "some" unknown reason, as soon as a URL to another page in my application is chosen, or a command button is chosen, the authenticated User is wiped out almost as if the SessionScoped bean is no longer in the session.

Is there something that I could be missing here that would be causing this issue?

Thanks in advance.

Edit: I removed the unnecessary managed property annotation from authenticatedUser.
Dave Bixler

Joined: Feb 12, 2010
Posts: 4
Problem solved. There are "two" SessionScoped attributes and I was importing the wrong one:

import javax.enterprise.context.SessionScoped;

Sometimes I really hate auto-import generation
I agree. Here's the link:
subject: Question about Session Scoped Bean
It's not a secret anymore!