Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

About session

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello
After I use getAttribute how can I yake what is in session nad write it froexaple like String.Do I neeed cast Objects
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"LaraCroft"
Obviously ficticious names are not allowed.
Please read the naming policy described at http://www.javaranch.com/name.jsp and change your display name accordingly.
Accounts that don't follow the naming policy get deleted.
Dave.
 
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yep ...

Originally posted by LaraCroft:
Hello
After I use getAttribute how can I yake what is in session nad write it froexaple like String.Do I neeed cast Objects

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
U better call the getClass() method on those objects in your session. It will return you the
Class type Object now call the getName() method on it.
This will return You the name of the class Your object belongs to in String. like:
Object obj = session.getAttribute("key");
Class c = obj.getClass();
String className = c.getName();
now you can check this String for any decision.
reply
    Bookmark Topic Watch Topic
  • New Topic