In the Struts documentation, it says:
Another common workflow stategy is to first render a page using an alternate method, like input and then have it submit back to the default execute method.
How to do it using annotation only? It seems that only the execute() method is called.
In the documentation it's said to render a page can be used an alternate method like
input. This means that when you submit a form on the page it can return back with theinputresult. Usually it happens automatically during validation process if the validation fails or ithasErrors. Then you can submit the form back to the default action'sexecutemethod. You don't need to specify amethodin the action configuration. Also if you didn't specify theactionattribute in theformtag then the same action will execute which was used to render a page.Configuring actions you can use the same page for
successresult when rendering a page usingGETmethod andinputwhenPOSTmethod is requested.To use annotations to configure actions mapping you can use a Convention Plugin.
Also note, to map a class method to the action you should put
@Actionannotation directly on this method rather than on the class.More detailed explanation and documentation you can find here.