aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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 ...?

 
Consider Paul's rocket mass heater.
 
subject: Use of @Before and @After annotation with example..
 
Similar Threads
problems with custom converters and move from Struts 2.0.11 to 2.1.6
program are excuted but server is showing errors
Validate method not completing
Getting an exception in Hibernate as I try to integrate Struts2 and Hibernate3
Struts2 with Display tag issue