> Hmm.
>
> When you call request.getSession(), have you already set the
> Thread.setContextClassLoader?
>
> It might be cleaner for us to add a "use-context-class-loader" as a
> <session-config>  configuration.
>
> -- Scotthttp://maillist.caucho.com/mailman/listinfo/resin-interest
Basically, I construct a classloader that extends URLClassLoader that 
points to the user's compiled classes. This classloader does 
myClassLoader.loadClass("name-of-the-controller-for-this-page").newInstance(), 
casts it to a "PageController" and runs it's execute() method 
(PageController interface). This makes sure that all operations in the 
PageController has access to the other controller-classes as well. The 
controller will see a variable called "session", that is basically a 
HashMap set as an attribute in the real HttpSession object. This HashMap 
will often contain variables that can only be serialized/deserialized 
using the same classloader that instantiated the PageController.

Maybe a better route is to configure my own serializer/deserializer? If 
I use a custom ObjectInputStream that overrides the loadClass() method 
and delegates to my special classloader, I should be home free. Is it 
possible to configure custom serializers in Resin? (I'm Running Resin 
Pro 4.0.17 2CPU).

-- Edvin



_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to