Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

preserving session formbeans

 
Chris Pat
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic