This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting NULL for session variable - why?  RSS feed

 
Christopher Frankland
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am sure there must be a simple explanation for this, however, I can't quite see it at the moment. The following value of the session var storeType is coming out as NULL.



Any ideas why I am getting NULL for the session.getAttribute("storeType")?

Thanks.
 
Dharmesh Chheda
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

try this

System.out.println("Store Type: " + session.getAttribute("storeType",PortletSession.APPLICATION_SCOPE));
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!