You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by SudhirSahoo <su...@gmail.com> on 2012/05/25 12:13:22 UTC

Get Declared Annotations in Inteceptor

I am sorry, if the question is a repeated one.

I am facing problem to get the declared method in my action class.
Below is is my code.

String actionMethod = invocation.getProxy().getMethod();
Method method =
invocation.getAction().getClass()*.getDeclaredMethod(XXXXXXXX); // Here is
my problem.*
Annotation[] annotations = method.getDeclaredAnnotations();

Is there a way, I can get directly all declared annotations of my invoked
action method ?


Thanks,
Sudhir

--
View this message in context: http://struts.1045723.n5.nabble.com/Get-Declared-Annotations-in-Inteceptor-tp5709840.html
Sent from the Struts - Dev mailing list archive at Nabble.com.

Re: Get Declared Annotations in Inteceptor

Posted by Łukasz Lenart <lu...@googlemail.com>.
Check AnnotationUtils from XWork


Regards
-- 
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Get Declared Annotations in Inteceptor

Posted by Maurizio Cucchiara <mc...@apache.org>.
Did you already try this:

method = invocation.getAction().getClass().getMethod(actionMethod, new
Class[0]);


Twitter     :http://www.twitter.com/m_cucchiara
G+          :https://plus.google.com/107903711540963855921
Linkedin    :http://www.linkedin.com/in/mauriziocucchiara

Maurizio Cucchiara


On 25 May 2012 12:13, SudhirSahoo <su...@gmail.com> wrote:

> Method method =
> invocation.getAction().getClass()*.getDeclaredMethod(XXXXXXXX); // Here is
> my problem.*
>