Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting Session Attribute Value

 
Steve Dyke
Ranch Hand
Posts: 1718
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: 65542
110
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: 1718
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:

 
Message for you sir! I think it is a tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!