wood burning stoves 2.0*
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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 ...?

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Use of @Before and @After annotation with example..