Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about Session Scoped Bean

 
Dave Bixler
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic