[jboss-user] [JBoss Seam] - Accessing Session bean properties from another bean

felixk2 do-not-reply at jboss.com
Wed Feb 6 12:58:20 EST 2008


Hi,

I'm trying to access a bean's property from another bean. Basically I have this action that gets executed when the user logs in and it stores some information I need that should be accessible by other pages.

This is simple if I need that information in the View. All I need to do is #{whatever.property}, but I need that property in another bean action. I'm trying to use FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("nameofbean") but I keep getting a class cast exception because the class returned isn't the class of the bean. (My bean has Session scope)

Anyone have any ideas how I can do this? I've been searching the forum, but I don't see anyone having this problem. I'm surprised because I would thing this would be needed by many people. Perhaps I am doing this incorrectly?

Thanks for the help,
Felix

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127115#4127115

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127115



More information about the jboss-user mailing list