You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by André Faria <an...@mandic.com.br> on 2007/01/05 21:06:57 UTC

Problems with Struts 2 and Spring AOP Resources

Hi All,

    I dont know exactly why but when I use Acegi Security with Spring 
AOP Interceptors that transforms the class with CGLib the Struts 2 
creates the Action, calls the class constructor two times...
I think that this effect is associated with the fact that the of the 
class changes after CGLib work. If someone have a light, peaple help-me.


Thats happen here:

Class com.opensymphony.xwork2.spring.SpringObjectFactory

    public Object buildBean(Class clazz, Map extraContext) throws 
Exception {
        Object bean;

        try {
            bean = autoWiringFactory.autowire(clazz, 
AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR, false); //Creates First 
Time
        } catch (UnsatisfiedDependencyException e) {
            // Fall back
            bean = super.buildBean(clazz, extraContext);
        }

        bean = 
autoWiringFactory.applyBeanPostProcessorsBeforeInitialization(bean, 
bean.getClass().getName());
        // We don't need to call the init-method since one won't be 
registered.
        bean = 
autoWiringFactory.applyBeanPostProcessorsAfterInitialization(bean, 
bean.getClass().getName()); //Creates Second Time
        return autoWireBean(bean, autoWiringFactory);
    }

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org