Meaningless Drivel is fun!*
The moose likes Struts and the fly likes ActionInvocation.getAction() method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ActionInvocation.getAction() method" Watch "ActionInvocation.getAction() method" New topic

ActionInvocation.getAction() method

MaheshS Kumbhar
Ranch Hand

Joined: Sep 24, 2009
Posts: 188
Assuming there is an action of type "MyAction", with a setDate(Date) method, this simple interceptor will set the date of the action to the current date:

My question here is, how does statement MyAction action = (MyAction)invocation.getAction(); will return our desired action instance named "MyAction"
I mean there might be other action instances present in ActionContext, then out of those how this interceptor will select MyAction?

I am slow but sure
It is sorta covered in the JavaRanch Style Guide.
subject: ActionInvocation.getAction() method
Similar Threads
Get the exception object into Interceptor
Need help for refreshing the page
interceptor not working in struts 2
Interceptors in Struts 2