Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
dhaval thakor
Ranch Hand
Posts: 53
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this code but not getting how to use @Before and @After annotation in struts2
please help me
 
Pyla Rao
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 53
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya i got it..but in given example what should i write in isAuthorized method..
can you please give me code ...?

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic