Hi folks - i'm trying to write an interceptor in struts2 that has access to the ApplicationMap in the application context.

My understanding is that the webwork API for ApplicationAware means that the interceptor will have it's setApplication(Map applicationData); triggered when the interceptor is run, thereby giving me access to the applicationcontext.

Problem is, it isn't :)

Here's the relevant parts...

public class DBInterceptor extends AbstractInterceptor implements ApplicationAware {

...

        @Override
        public void setApplication(Map arg0) {
                logger.info("Receiving applicationMap...");
                this.applicationMap = arg0;
        }

That logger is never triggered, 'applicationMap' is always null.

My struts.xml is:
<interceptors>
<interceptor name="dbsetup" class="com.stonekeep.congo.interceptors.DBInterceptor" />
        <interceptor-stack name="mystack">
                <interceptor-ref name="dbsetup" />
                <interceptor-ref name="defaultStack" />
        </interceptor-stack>
</interceptors>

(The goal here is to store a c3p0 connection pool object in the application context, so that I can get a connection from it on every hit - I assume this is the proper way to do this?)

Thanks, any help would be appreciated...

        -dbs

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to