Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting Session Attribute Value  RSS feed

 
Steve Dyke
Ranch Hand
Posts: 1775
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I have the following in one of my servlets:



What is the correct syntax for using the value of that attribute? The following is obviously wrong(Object - int).

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66199
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because getAttribute() returns an Object, the result must be cast.
 
Steve Dyke
Ranch Hand
Posts: 1775
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Because getAttribute() returns an Object, the result must be cast.


Thanks, I got this to work:

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!