Another way to get the annotation associated with the executed action is
private static boolean isAnnotationPresent(ActionInvocation
actionInvocation,
Class annotationClass) {
return
getMethodFromInvocation(actionInvocation).isAnnotationPresent(
annotationClass)
Thanks!
A complete code sample at:
http://stackoverflow.com/questions/24021534/struts-2-get-custom-action-anotation-in-interceptors
~Regards,
~~Alireza Fattahi
On Wednesday, 4 June 2014, 12:22, Lukasz Lenart wrote:
Take a look on com.opensymphony.xwork2.util.AnnotationUtils
2014-06-0
Take a look on com.opensymphony.xwork2.util.AnnotationUtils
2014-06-03 19:37 GMT+02:00 Alireza Fattahi :
> Consider below action class with three action mappings. Two of them are
> annotated with a custom annotation `@AjaxAction`
>
> public class MyAction extends ActionSupport{
>
> @Act
Just get the action and check for the annotation.
On Jun 3, 2014 1:41 PM, "Alireza Fattahi"
wrote:
> Consider below action class with three action mappings. Two of them are
> annotated with a custom annotation `@AjaxAction`
>
> public class MyAction extends ActionSupport{
>
> @Action("
4 matches
Mail list logo