Struts 2 ActionInvocation

In this tutorial you will learn about the Struts 2 ActionInvocation and its application with practical example.

Struts 2 ActionInvocation

ActionInvocation holds the Interceptors and the action instance, it represents the execution state of an Action. This interface extends Serializable interface, syntax is below:

Table Of Contents

Syntax:-

ActionInvocation Methods

There are some useful methods of this interface are listed below.

1.Object getAction(): This method is used to get the Action which is associated with this interface.

2.ActionContext getInvocationContext(): This method is used to get the ActionContext associated with the ActionInvocation.

3.ActionProxy getProxy(): This method is used to get the ActionProxy holding this ActionInvocation.

4.Result getResult(): This method returns the Instance of Result.

5.ValueStack getStack(): This method is used to get the ValueStack associated with this ActionInvocation.

6.void setResultCode(String resultCode): This method is used to set the Result code.

7.String getResultCode(): This method returns the ResultCode from this ActionInvocation

In this tutorial we have learn about the Struts 2 ActionInvocation and its application with practical example. I hope you will like this tutorial.