how do I save data between two events in ActionBean? In the following example I create contact in addContact()
, preserve it and save it to attribute contact
. When i try to access that contact
after redirectction, in addNumber()
, its null.
private Contact contact;
...
public Resolution addNumber() {
log.debug("addNumber() to contact={}", contact);
return new ForwardResolution("/addNumber.jsp");
}
public Resolution addContact() {
log.debug("addContact() - name={}", name);
contact=contactFacade.create(name, surname));
log.debug("addContact() OK - contact={}", contact);
return new RedirectResolution(this.getClass(), "addNumber");
}
What am I doing wrong?