struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject [s1,validation] Multi-page flow, session-scoped DynaValidatorForm with checkbox
Date Fri, 17 Jun 2011 19:33:22 GMT
Hash: SHA1


I can't believe I've been working with Struts for nearly 10 years and
I'm only now attempting to use a multi-page flow with a form bean in the

Of course, I'm having difficulty with checkboxes.

Our (simplified) flow looks something like this:

P1 -> A1 ---> P2 -> A2 ---> Done

"P1" contains a checkbox called "emailNotification". The bean is defined
with a <form-property name="emailNotification" type="java.lang.String" />

The "Done" page would like to use the value of that form property to
decide (you guessed it) whether or not to notify someone via email.

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're using).

I've been looking at the "reset" attribute of the <form-property>
element in struts-config.xml and, at first glance, it looks promising.

Reading the code, however, it looks like setting reset="true" will end
up re-setting the form property to null (or blank string) upon every
request, meaning that my multi-page flow will have to repeat that form
element on every page.

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 (if you ignore the
chicken-in-the-egg problem of inspecting the request before resetting
the form before ... inspecting the request).

Is my analysis above correct?

What is the recommended technique when dealing with multi-page,
session-scoped dynamic forms?

- -chris
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message