Storing a class object within the user session - is this possible?


Is there a way to store a class object within the session.
I can store a complex type such as a class object within the session by serialising the object but
not all objects used have serialisation implemented, third party libraries etc.


val createClass = exec((session) => {
  val foo: regClass = new regClass 
  session.set("regClass", foo)

val setup = exec((session) => {

Short answer is yes. When you access it, you just have to type-cast it to the right type. No serialization and de-serialization required. Play around with it and see what you find.