Two Laptop Bag*
The moose likes Struts and the fly likes Use of @Before and @After annotation with example.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Use of @Before and @After annotation with example.." Watch "Use of @Before and @After annotation with example.." New topic
Author

Use of @Before and @After annotation with example..

dhaval thakor
Ranch Hand

Joined: Aug 27, 2012
Posts: 53

I have this code but not getting how to use @Before and @After annotation in struts2
please help me
Pyla Rao
Ranch Hand

Joined: Jul 10, 2012
Posts: 50
Hi,

Before and After annotations in Struts framework used for Interceptor in struts. Interceptors introduced in struts 2.

To use these annotations, you have to specify the AnnotationWorkflowInterceptor to your interceptor stack.

After Annotation->Marks a action method that needs to be executed after the result.
Before Annotation->Marks a action method that needs to be executed before the main action method.

Thank you.
Pyla.
dhaval thakor
Ranch Hand

Joined: Aug 27, 2012
Posts: 53

Ya i got it..but in given example what should i write in isAuthorized method..
can you please give me code ...?

 
jQuery in Action, 2nd edition
 
subject: Use of @Before and @After annotation with example..
 
Similar Threads
Struts2 with Display tag issue
Getting an exception in Hibernate as I try to integrate Struts2 and Hibernate3
Validate method not completing
problems with custom converters and move from Struts 2.0.11 to 2.1.6
program are excuted but server is showing errors