I'm new to struts and I'm migrating a project form struts-1 to struts-2 where multiple methods are being called in same action class from the same jsp. The UI has lot of elements which were dynamically loaded based on the prev values. They're going to the action(method) using onclick and
form.action=/App/action?method=methName
form.submit()
in struts-1 which I've changed to
form.action=/App/actionNameChangeField
form.submit()
on field change to load the field elements below.
I've written separate actions to the methods like this
<action name="actionNameChangeField" class="com.org.RequestAction" method="changeField">
<result name="createRequest" type="tiles">page.createRequest</result>
</action>
But when the request comes, I think a new RequestAction object is being created because all the fields are reset/reinitialized and data from previous request is lost. This doesn't seem to be a issue when it goes to a different action class.
Is there any way to persist the field data when the action is invoked on the same action class?