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

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

 
Vineet kumar Gupta
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to access the session scoped bean named "loginbean" into another bean ...how can i do it ???
 
Vineet kumar Gupta
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Hi Vineet,



Hope above code will work for you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic