Re: Struts 2 custom ClassLoader

2009-09-24 Thread Wes Wannemacher
One place to start is the XmlConfigurationProvider in xwork. Struts has its own XmlConfigurationProvider, imaginatively named StrutsXmlConfigurationProvider, but struts' version simply overrides xwork's and sets some filenames to be struts-*.xml and struts.properties, etc. then injects the ServletC

Re: Struts 2 custom ClassLoader

2009-09-24 Thread Andriy Pererva
Thank you so much, guys! I created the custom ObjectFactory, override the only method - getClassInstance() in order to enforce Struts to use my custom ClassLoader, so now all the action classes load from the "right place". Now just one problem remained. Some of my struts.xml's parts should also sta

Re: Struts 2 custom ClassLoader

2009-09-09 Thread Musachy Barroso
In fact, the spring plugin contains an example of a custom classloader. We have a classloader there that reloads classes, that should give you some ideas. musachy On Wed, Sep 9, 2009 at 6:41 AM, Wes Wannemacher wrote: > I don't know if I would override the class loader (did I suggest that > earli

Re: Struts 2 custom ClassLoader

2009-09-09 Thread Wes Wannemacher
I don't know if I would override the class loader (did I suggest that earlier, if so, sorry :( ). I would take a look at overriding the buildBean methods. Use your custom classloader to build the 'beans' but do it in a way that tries your classloader first, then falls through to the super class...

Re: Struts 2 custom ClassLoader

2009-09-09 Thread Andriy Pererva
Hello, Wes! Thank you for your quick help! I did exactly what you advised me, but something still doesn't work. Here are my steps: 1) Created CustomObjectFactory which extends StrutsObjectFactory, with only one method overriden - setClassLoader(). Inside this method I simply pass my custom classloa

Re: Struts 2 custom ClassLoader

2009-09-03 Thread Wes Wannemacher
I would suggest creating your own plugin... If the custom classes are actions, validators, interceptors and type converters then just take a look at the spring plugin for an example. You will want to write your own implementation of the ObjectFactory, the ObjectFactory is in charge of creating the

Struts 2 custom ClassLoader

2009-09-03 Thread Andriy Pererva
Hi, all! I'm working on a big java web project, which is based on Struts 2 framework. Now we are going to do some refactoring and split the project up in some parts: core and other auxillary functionality modules. Core classes located under classpath, but all the auxillary functionality classes wil