Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting Session Attribute Value

 
Steve Dyke
Ranch Hand
Posts: 1679
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
Pie
Posts: 65223
95
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: 1679
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