Custom interceptor not firing
All, I set up a custom interceptor, but it is not being invoked. As far as I can tell from looking at _Struts 2 in Action_, I constructed my class correctly. It is named CompanyIdentificationInterceptor. 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 / Have I missed something? Thanks, Wes - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Custom interceptor not firing
Hi, 2008/6/10 Gamble, Wesley (WG10) [EMAIL PROTECTED]: As far as I can tell from looking at _Struts 2 in Action_, I constructed my class correctly. It is named CompanyIdentificationInterceptor. The name is not important, did you implement com.opensymphony.xwork2.interceptor.Interceptor interface or extend com.opensymphony.xwork2.interceptor.AbstractInterceptor? Regards -- Lukasz http://www.lenart.org.pl/
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]
RE: Custom interceptor not firing
I started out implementing the interface and then when I couldn't get it to work, I also extended the abstract class. I assume that the interceptor needs a default constructor as well? Wes -Original Message- From: Lukasz Lenart [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2008 2:00 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED] Subject: Re: Custom interceptor not firing Hi, 2008/6/10 Gamble, Wesley (WG10) [EMAIL PROTECTED]: As far as I can tell from looking at _Struts 2 in Action_, I constructed my class correctly. It is named CompanyIdentificationInterceptor. The name is not important, did you implement com.opensymphony.xwork2.interceptor.Interceptor interface or extend com.opensymphony.xwork2.interceptor.AbstractInterceptor? Regards -- Lukasz http://www.lenart.org.pl/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Custom interceptor not firing
I am using Annotation-based actions. I am starting to suspect that they are not hooked up to the interceptor stack by default. Is that right? Is there some annotation that I can use to get interceptors to fire? -Original Message- From: Lukasz Lenart [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2008 2:00 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED] Subject: Re: Custom interceptor not firing Hi, 2008/6/10 Gamble, Wesley (WG10) [EMAIL PROTECTED]: As far as I can tell from looking at _Struts 2 in Action_, I constructed my class correctly. It is named CompanyIdentificationInterceptor. The name is not important, did you implement com.opensymphony.xwork2.interceptor.Interceptor interface or extend com.opensymphony.xwork2.interceptor.AbstractInterceptor? Regards -- Lukasz http://www.lenart.org.pl/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Custom interceptor not firing
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-namestruts-cleanup/filter-name filter-class org.apache.struts2.dispatcher.ActionContextCleanUp /filter-class /filter filter filter-namestruts2/filter-name filter-class org.apache.struts2.dispatcher.FilterDispatcher /filter-class /filter filter-mapping filter-namestruts-cleanup/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namestruts2/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]