aspose file tools*
The moose likes Struts and the fly likes preserving session formbeans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "preserving session formbeans" Watch "preserving session formbeans" New topic
Author

preserving session formbeans

Chris Pat
Ranch Hand

Joined: Aug 27, 2005
Posts: 156
Hello
I am using a html:link to transfer directly to a global forward that is actually an action. The problem is I need a formbean member value that I know positively, and visually, is in the bean before I html:link forward="", but it is not there in the action. This action works correctly when I use it in the "preload" stage with the desired form bean member populated. After one iteration I again see that the desired form bean member is populated, but when come in from the html:link it is null. What struts tag can I use to preserve the full state of my session attributes and formbean and forward to an action? tia.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

If the actions are configured with the same form bean the form should still be in the session. If your form has a reset() I'm not sure what the behavior would be.
Chris Pat
Ranch Hand

Joined: Aug 27, 2005
Posts: 156
Hi David
Thank you.
That is what I find so peculair. The formbean is the same throughout. On my "reenter" page, the one that has the html:link, I am using jstl to prove that the member of the formbean is there and has the values expected. Problem is when I click on the link and take it into the action it is null. This is struts1. The forward is a global forward that just points to the default context action *.do. I know how totally odd this is. Is there a way of getting the class of a formbean in a session to print out?
Chris Pat
Ranch Hand

Joined: Aug 27, 2005
Posts: 156
Hi
Sorry, move along, grin
I had set the scope to request and guess what that works. Reset it to session and all is well. Sorry for the intrusion of an unnecessary inscrutable.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: preserving session formbeans