Hi,
I would like to share the same action form bean between 2 Action classes.
I find that while invoking the 2nd Action form from the 1st using a global Forward, the values in the bean are reset to its original status, as when passed to Action 1, while invoking the Action 2. This happens even though I explicilty reset certain values before forwarding to Action 2
Can anyone tell me why this is happening or where I am going wrong. -
For instance -
I have a commonActionFormBean.java
My edit.jsp invokes the Edit Action class. It however, also contains a delete button which has the following get/set methods in the bean -
private
String delete = null;
// Get delete button
public String getDelete() {
return delete;
}
// Set delete button
public void setDelete(String newDelete) {
this.delete = newDelete;
}
In my Edit Action class I check --
if (eform.getDelete() != null )
{
---- do something ---
formbean.setDelete(null);
return (mapping.findforward("delete"));
}
------
"delete" is a global forward to invoke deleteAction.do.
I find that the delete button is reset to null, however, while invoking deleteAction, it is again reset to delete = "delete";
----
Secondly, if I use 2 different sets of beans, how can I pass the values of one bean to that of the 2nd through the action classes or how can I use the Action 1 bean in Action 2.
Thanks