-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dave,

Thanks for the quick reply.

On 6/17/2011 3:46 PM, Dave Newton wrote:
> On Friday, June 17, 2011, Christopher Schultz wrote:
>> I can't believe I've been working with Struts for nearly 10 years and
>> I'm still using Struts 1.
> 
> Fixed.

Yeah, really.

>> The problem is that if we check the box and submit to A2 (then show P2),
>> then go back (either browser-BACK or using our "previous" button in the
>> flow), then re-submit to A2, the form property in the bean stays set to
>> "true" (or whatever value we'r [...]
> 
> Not sure why it wouldn't, it's a session form, so alterations will
> persist over multiple pages, unless I'm misunderstanding what you've
> said.

My reading of the code is that with reset="true", the property will be
blanked-out on every request. Our solution (which seems to be working,
so at this point, this is just an academic discussion) was to do the
following:

1. Use reset="POST" -- we have a lot of GET-follows-POST semantics
2. Make sure the form element is included on every page of the flow

Now, #2 wasn't tough to do because all of our multi-page flows are coded
this way no matter what the scope of the form bean: we want to be able
to recover from a session-timeout without losing all the work the user
has put into filling it out.

So, basically, we just had to do #1 above and we were good to go.

Is that recommended technique in these cases where checkboxes need to be
reset?

>> I would have figured that DynaValidatorBean would be sensitive to the
>> current "page" of the flow and only reset properties with a page number
>> at or higher than the currently-being-submitted page
> 
> I'm not aware of any page number/flow functionality in S1, but I
> stopped using it around 1.2.9--is flow functionality something from
> 1.3, or did I just miss it altogether?

The validation framework understands the "page number" in order to
perform up-to-page-N validation, but I'm not sure the form itself has
any notion of the page numbering. Since DynaValidatorForm is tied-into
the validation framework, I wasn't sure if there were any super-smarts
there or not. Lots of classes, lots of code ;)

>> What is the recommended technique when dealing with multi-page,
>> session-scoped dynamic forms?
> 
> IIRC this was a PITA in S1, I always coded reset methods and had a
> mini-state-machine implementation.

Yeah, it really is a PITA. My review of an S2 book a while back got me
all excited about all the really great stuff in S2: IMO, it's the way
things should have been all along -- but nobody knew any better at the
time. Too bad "upgrade to a largely incompatible library" isn't a real
driving requirement for a product. :(

Thanks,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk37s3AACgkQ9CaO5/Lv0PCyaQCgpBg+yz75uW0XdkS13brdccGL
3HgAoL+rP4278HbhQ0qbKD+UaEX8KMWQ
=wSq9
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to