You don't have any action mappings (that I see), so there's nothing for
these interceptors to apply to. Add the following to your web.xml:

<filter>
        <filter-name>struts-cleanup</filter-name>
                <filter-class>
                        org.apache.struts2.dispatcher.ActionContextCleanUp
                </filter-class>
        </filter>
    <filter>
        <filter-name>struts2</filter-name>
        <filter-class>
            org.apache.struts2.dispatcher.FilterDispatcher
        </filter-class>
    </filter>
        <filter-mapping>
                <filter-name>struts-cleanup</filter-name>
                <url-pattern>/*</url-pattern>
        </filter-mapping>
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
        </filter-mapping>

And then add an action mapping to your struts xml, like:

  <package name="ApplicantTracking" extends="tiles-default">
        <interceptors>
          <interceptor name="companyInterceptor"
class="com.tmw.applicant.tracking.interceptors.CompanyIdentificationInte
rceptor" />
                
          <interceptor-stack name="customStack">        
                <interceptor-ref name="companyInterceptor" />           
                <interceptor-ref name="defaultStack" />
          </interceptor-stack>          
    </interceptors>
        
        <default-interceptor-ref name="customStack" />

        <action name="Index" class="com.opensymphony.xwork2.ActionSupport">
                        <result name="success">/jsp/index.jsp</result>
                </action>
  </package>  


Then when you go to http://(your-app-address)/ApplicantTracking/Index.action
You will see the interceptors apply

-----Original Message-----
From: Gamble, Wesley (WG10) [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 10, 2008 3:03 PM
To: Struts Users Mailing List
Subject: RE: Custom interceptor not firing

I suspect that I don't have any interceptors firing at all.  I can
change the value of "default-interceptor-ref" to "xxx" or anything and
nothing happens either on application startup or on action invocation.
Here is the entirety of my struts.xml file:

<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts
Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd";>

<struts>
  <constant name="struts.devMode" value="true" />
  <constant name="struts.configuration.xml.reload" value="true" />
  <constant name="struts.ui.theme" value="css_xhtml" />
  <constant name="struts.custom.i18n.resources" value="global-messages"
/>
  <constant name="struts.locale" value="en_US" />
  
  <package name="ApplicantTracking" extends="tiles-default">
        <interceptors>
          <interceptor name="companyInterceptor"
class="com.tmw.applicant.tracking.interceptors.CompanyIdentificationInte
rceptor" />
                
          <interceptor-stack name="customStack">        
                <interceptor-ref name="companyInterceptor" />           
                <interceptor-ref name="defaultStack" />
          </interceptor-stack>          
    </interceptors>
        
        <default-interceptor-ref name="customStack" />
  </package>  
</struts>

-----Original Message-----
From: Gamble, Wesley (WG10) [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 10, 2008 1:22 PM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: Custom interceptor not firing

My struts.xml file now has this configuration in it to accommodate this
new interceptor:

<interceptors>
   <interceptor name="companyInterceptor"
class="com.tmw.applicant.tracking.interceptors.CompanyIdentificationInte
rceptor" />
                
     <interceptor-stack name="customStack">     
                <interceptor-ref name="companyInterceptor" />           
                <interceptor-ref name="defaultStack" />
     </interceptor-stack>               
</interceptors>
        
<default-interceptor-ref name="customStack" />


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




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

Reply via email to