Link to home
Start Free TrialLog in
Avatar of pradumb29
pradumb29

asked on

Class Cast Exception while finding all the session attributes

Hi,
I am using struts version 1.2.9 and am trying to get all the session variables to check for all the value with the following piece of code but am getting a class cast exception with it.
Any idea why this is happening ?
      java.util.Enumeration allParameter = session.getAttributeNames();          
          if (null!=allParameter)
          {  
              while(allParameter.hasMoreElements())
              {

                   String attribValue=(String)session.getAttribute(allParameter.nextElement().toString());

              }
          }
       
          }
ASKER CERTIFIED SOLUTION
Avatar of Venabili
Venabili
Flag of Bulgaria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial