Introduction 🤨
Struts is an open-source web application that the Apache software foundation develops. It helps in the development of Java EE web applications. It uses and extends the Java Servlet API to encourage developers to adopt a model–view–controller architecture. In this article related to struts, we will learn about Action Invocation in the next section.
Action Invocation 👨🏿
Action Invocation holds the execution state inside the struts, it holds the action and interceptors objects. The Struts also offers an Action Invocation Interface to handle it, let us read it in the next section.
Action Invocation Interface,
The Struts framework, Action Invocation Interface offers an ActionInvocation Interface to handle the ActionInvocation. Numerous methods are available, some of which assist in obtaining instances of ActionProxy, ActionContext, ValueStack, Result, etc.
The syntax for it is public interface ActionInvocation extends Serializable
This Interface contains many different types of methods that are commonly used, let us see them in the following table.
Methods of Action Invocation Interface
S.No | Method | Description |
1 | public ActionContext getInvocationContext() | The ActionContext object connected to the ActionInvocation is returned. |
2 | public ActionProxy getProxy() | It gives the ActionProxy object that is currently holding this ActionInvocation. |
3 | public ValueStack getStack() | It returns the value of valuestack() |
4 | public Action getAction() | It gives the Action instance connected to this ActionInvocation. |
5 | public void invoke() | It carries out the next resource call in this ActionInvocation's processing. |
6 | public Result getResult() | It returns the instance of Result. |
With this, we come to the end of the blog about action invocation in struts, and I hope you found this blog interesting and insightful.