File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes ActionForm losing values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ActionForm losing values" Watch "ActionForm losing values" New topic
Author

ActionForm losing values

John Smith
Ranch Hand

Joined: Sep 02, 2004
Posts: 61
I'm having trouble with an ActionForm of mine losing the values I set in it. The form page has some drop-downs whose options are generated from bean lists set in pop-ups, I need to be able to refresh the page and have the form retain it's values as set in the other fields. I've put redirect="false" in all action mapping and put empty reset methods in the relevant form classes and it still doesn't work, any bright ideas?
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Is the form request scope? If so, the refresh would create a brand-spankin' new ActionForm.


A good workman is known by his tools.
Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
Originally posted by Marc Peabody:
Is the form request scope? If so, the refresh would create a brand-spankin' new ActionForm.


Yeah, I was going to say the same thing. What happens if you set the form bean to be in session scope?


SCJP Tipline, etc.
John Smith
Ranch Hand

Joined: Sep 02, 2004
Posts: 61
Umm yeah I presume it's session scope, I'm using the form-bean mapping in the struts-config.xml ... I don't think it creates a new form because I printed the class instance.toString() in the Action's execute method and it stays at the same memory address. Usually the forms keep values unless I clear them with the xml mapping method but this one is the opposite for some reason
ss kumar
Greenhorn

Joined: Jan 14, 2004
Posts: 19
Hi John Smith ...Was your problem resolved??...please let me know , I am in the same boat. I want to keep the values selected in my select box. I tried making the scope to session and also using the redirect=false in the struts-config.xml

Thanks in advance.
shoban


Thanks,<br />Shoban Sriram
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ActionForm losing values