i read that section on that page 10 times and i don't know how that relates to my problem. there's simply not enough information. i guess it's pointing me to something about namespaces, but, how do we get around this?
on the other hand, the rest of that page was informative on annotations and the convention plugin. when i added interceptorref...@interceptorref("dummyStack")} to the Action class' execute method, the web application won't start up. ERROR com.opensymphony.xwork2.util.logging.commons.CommonsLogger.error(CommonsLogger.java:27) - Dispatcher initialization failed ... Caused by: Unable to find interceptor class referenced by ref-name dummyStack - [unknown location] how hard can it be to get this to work? interestingly, if i do this, interceptorref...@interceptorref("defaultStack")}, all is fine and dandy (but then, my Interceptor is not called). On Sat, Jan 30, 2010 at 4:37 PM, Dave Newton <newton.d...@yahoo.com> wrote: > > http://struts.apache.org/2.x/docs/convention-plugin.html#ConventionPlugin-XWorkpackages > > > ----- Original Message ---- > > From: Jake Vang <vangj...@googlemail.com> > > To: user@struts.apache.org > > Sent: Sat, January 30, 2010 4:10:31 PM > > Subject: interceptor is not being called for all action > > > > i have written an interceptor implementation, however, it seems i cannot > get > > it to work. i have followed the instructions at > > http://struts.apache.org/2.x/docs/interceptors.html. i have also > followed > > the instructions at > > > http://struts.apache.org/2.x/docs/how-do-we-configure-an-interceptor-to-be-used-with-every-action.htmlto > > use the interceptor with every action. > > > > however, when any of my actions run, i never see the pre and post > processing > > logging messages (logging messages inside the intercept method). i do see > > the logging messages from the init and destroy methods. this is not a > > problem with logging (as for sanity checking, i also use > System.out.println, > > and have Tomcat running in console mode). i also have placed some break > > points in the intercept(ActionInvocation) method, but these break points > are > > never reached. > > > > this is my struts.xml. > > > > > > > > > > > > class="mypackage.DummyInterceptor"/> > > > > > > > > > > > > > > > > > > > > this is my DummyInterceptor class. > > > > public class DummyInterceptor implements Interceptor { > > private static final Log _log = > > LogFactory.getLog(DummyInterceptor.class); > > public void destroy() { > > _log.debug("dummy interceptor destroyed called"); > > System.out.println("dummy interceptor destroyed > > called".toUpperCase()); > > } > > public void init() { > > _log.debug("dummy interceptor init called"); > > System.out.println("dummy interceptor init > called".toUpperCase()); > > } > > public String intercept(ActionInvocation actionInvocation) throws > > Exception { > > _log.debug("dummy interceptor intercept pre processing"); > > System.out.println("dummy interceptor intercept pre > > processing".toUpperCase()); > > > > String result = actionInvocation.invoke(); > > > > _log.debug("dummy interceptor intercept post processing"); > > System.out.println("dummy interceptor intercept post > > processing".toUpperCase()); > > return result; > > } > > } > > > > i am using annotations for my Action classes, so i do not define any > > elements in struts.xml (using the Struts2 Convention jar). > > > > one very interesting thing i did was to get struts-default.xml out of the > > struts2-core-2.1.8.1.jar. i then modified struts-default.xml by adding: > 1) a > > definition of my interceptor and 2) my interceptor onto the defaultStack. > > when i did this, my interceptor does work as expected (i see logging > output > > from the intercept method, i can hit break points set inside this method) > > for all my actions. > > > > i wonder if there is some gotcha that i am missing here. is there > something > > extra that i have to do when mixing annotations with interceptors? > > > > thanks. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >