Website actions, life cycle of variables declared in action class

I am using webwork framework (JARA plugin development) and was wondering about the lifecycle of variables in an action class.

I have several private variables in an action class that are set during the doDefault () method.

These are used in the input view to customize the jqGrid columns, and then when the user has entered some data, click submit, which puts the grid data in hidden input.

The next thing that happens is the doValidation () method is called before doExecute (), which displays the input view if there are any errors.

The problem is that the variables set in the doDefault () method are now null.

Can anyone explain to me how the lifecycle of variables works in website actions?

Greetings

+2


a source to share


2 answers


The action does not persist between calls. You will need to run those calculations again, or store them somewhere (in a page or in a session).

Main life cycle:



Browser requests page -> action created -> action returns result -> results page returned to browser

+2


a source


For more details and examples related to JIRA, see the sample webpage at https://plugins.atlassian.com/plugin/details/17189

"This plugin is a set of working samples that demonstrate how to create JIRA web pages using JSP, Webwork1, and Velocity template files. Note: This plugin requires you to download the source and build it yourself.



I am the author of the plugin.

~ Matt

+2


a source







All Articles