I have a session scoped form that has an attribute that I'd like to get access to from an action that does not use that form as its input. I'd assume that since the form is session scoped the data has to be in there *somewhere*, but short of writing code to dump the session and trying to figure it out, I was hoping that someone could answer this off the top of their head.
In case anyone is interested, session scoped forms are stored in the session by setting a session attribute to the entire form bean. The session attribute is named with the name given to the form in the struts config file.
For example, you have a form of type "com.mydomain.FooForm" named "fooForm". If that form is session scoped, there will be an attribute in the session named "fooForm" and it will be an object of type "com.mydomain.FooForm". Once you get that object from the session, it's trivial to call getters and setters to get at the data in it.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop