java - Handling data in ActionBean -


How do I save data between two events in ActionBean? In the following example I can make a contact in addContact () , preserve it and save it for the contact attribute. addNumber () , its null

  In a personal contact contact, when I try to use that redirect after  contact ; ... public solution addNumber () {log.debug ("addNumber () to contact = {}", contact); Return to the new forward resolution ("/ addNumber.jsp"); } Public resolution addContact () {log.debug ("addContact () - name = {}", name); Contact = contactFacade.create (name, surname)); Log.debug ("addContact () OK - contact = {}", contact); Return new redirect revolutions (this.getClass (), "addNumber"); }  

What am I doing?

This should work:

  public solution addContact () { Log.debug ("addContact () - name = {}", name); Contact = contactFacade.create (name, surname)); Log.debug ("addContact () OK - contact = {}", contact); // To add this action, after redirection in the flash region, bean in the flash field to maintain new redirect resolution (this.getClass (), "addNumber"). Flash (this); }  

Source:


Comments

Popular posts from this blog

MVP, design question -

excel - Populate list via a bi-Condition -

iphone - How do I make a UIPickerView in a UIActionSheet -