struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stanl...@gmail.com
Subject Re: How to get method name in interceptor
Date Thu, 21 Feb 2008 12:59:18 GMT
Tell me more.  One thing I have learned using Struts 2 is if you think it
should be possible, it probably is!  What are you trying?

On Thu, Feb 21, 2008 at 1:29 AM, Toni Lyytikäinen <tolyen@gmail.com> wrote:

> Thanks. This approach works, but isn't quite as elegant as I was hoping.
>
> On Wed, Feb 20, 2008 at 2:47 PM, <stanlick@gmail.com> wrote:
>
> > download the breadcrumb
> > <http://strutsschool.com/downloads/downloads.action>interceptor
> > and look at the intercept method.  You will see what's happening right
> > away.
> >
> >
> >
> > On Wed, Feb 20, 2008 at 5:40 AM, Toni Lyytikäinen <tolyen@gmail.com>
> > wrote:
> >
> > > Hi,
> > >
> > > I'm trying to access the ActionMapping from an interceptor, like the
> > > following test stub:
> > >
> > > public String intercept(ActionInvocation invocation) throws Exception
> {
> > >    ActionMapping am=ServletActionContext.getActionMapping();
> > >    log.info("The method is "+am.getMethod());
> > >    return invocation.invoke();
> > >    }
> > >
> > > According to the javadocs am.getMethod() should return a String (the
> > > method), but for some reason am.getMethod() always returns null. The
> > > am.getName() and am.getNamespace() methods seem to work correctly
> > however.
> > > Is there a way (that works) to extract the name of the method that is
> > > going
> > > to be executed?
> > >
> >
> >
> >
> > --
> > Scott
> > stanlick@gmail.com
> >
>



-- 
Scott
stanlick@gmail.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message