Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

My own Interceptor with <param>eters

Valentin von Seggern

2007-03-16

Replies:

Hi List,
I need my own interceptor to be able to access parameters. In my
struts.xml I have something like:
....
<interceptor name="myInter" class="MyInterceptor">
  <param name="cid">1234</param>
</interceptor>
....
My Interceptor Stack contains:
....
<interceptor-ref name="myInter"><param
name="cid">987</param></interceptor-ref>
....

Looking through the source code of Interceptors that have parameters
like this, I figure that reflection is supposed to happen.
In MyInterceptor.java implementation I hence have this:
....
  public void setCid(String cid){
    LOG.debug("setCid(String) was called");
  }  
  public void setCid(Object cid){
    LOG.debug("setCid(Object) was called.);
  }
....
I expect either of this methodes to be invoked. But this does not happen.

I guess I am missing something quite obvious but extensive documentation
browsing didn't enlighten me. If you can please do - Your help is
appreciated.

Thank you,
Valentin

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.