• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with the session in a JSTL  RSS feed

 
Reggie McDougal
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm trying to get the following code to run...

try{
if (session.getAttribute("arraycache") == null) {
// set it
session.setAttribute("arraycache", new ProductGeneralFunctions());
} else {
pgfHelper = (ProductGeneralFunctions) session.getAttribute("arraycache");
}

etc.

When initialised, the attribute starts as null, so the setAttribute call works, but on subsequent page loads I get a ClassCastException.

Any ideas? (yes pgfHelper is declared as of the type ProductGeneralFunctions)
 
Reggie McDougal
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey it works now - I implemented Serializable in ProductGeneralFunctions and it stopped throwing the Exception.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!