GeeCON Prague 2014*
The moose likes JSF and the fly likes trying to access a session scoped bean in another bean which has application scope Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "trying to access a session scoped bean in another bean which has application scope " Watch "trying to access a session scoped bean in another bean which has application scope " New topic
Author

trying to access a session scoped bean in another bean which has application scope

Vineet kumar Gupta
Greenhorn

Joined: Dec 18, 2011
Posts: 16
if the scope of loginbean is session then it should not be null...


pw.println("hello"+cont.getExternalContext().getSessionMap().get("loginbean"));
but it is showing hello null
....anyone help ???
Vineet kumar Gupta
Greenhorn

Joined: Dec 18, 2011
Posts: 16
i want to access the session scoped bean named "loginbean" into another bean ...how can i do it ???
Vineet kumar Gupta
Greenhorn

Joined: Dec 18, 2011
Posts: 16
but if i do like that


pw.println("hello"+cont.getExternalContext().getSessionMap().get("validbean"));

here validbean is a bean which have application scope/session scope ...means i am trying to access loginbean into validbean...

.
what is the location where l can get the loginbean ....??? getsessionmap() is not containing that

someone please help
Ravi Choudhary
Greenhorn

Joined: Sep 03, 2009
Posts: 16


Hi Vineet,



Hope above code will work for you.

RaviKumar
SCJP 5.0, Preparing for Next
 
GeeCON Prague 2014
 
subject: trying to access a session scoped bean in another bean which has application scope