Why not use JavaScript for preliminary validation of the form?
Sounds like your main issue is a user not entering a value in a field.


-----Original Message-----
From: Jon Wynacht [mailto:[EMAIL PROTECTED]
Sent: Sat 3/8/2008 7:31 PM
To: user@struts.apache.org
Subject: Advice on Handling From Validation
 
Hi,

I have the following scenario running with an application:

1. A setup action gets called and a form bean gets created, some  
lists in the form bean are populated with collections and then the  
whole mess gets sent to the user.

2. The user fills out the form and clicks save.

3. A save action gets called but before that, validation happens (the  
form bean extends ValidatorForm) and finds the user forgot to enter a  
title. The user is forwarded to the form jsp to correct the error but  
the collections are no longer available.

4. Huge error ensues, user is mad, money is lost.

After doing some research it seems that I have a couple of options:

1. When validation fails, return the user to an action instead of  
directly to the jsp. Said action can repopulate the list and things  
are good to go.

2. Session scope the form bean.

3. Use AJAX to populate the collections on the form and forgetaboutit.

Are there best practices for this sort of thing? Am I missing  
anything else?

Thanks in advance for your help.

Cheers,

Jon

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







Blue Cross Blue Shield of Florida, Inc., and its subsidiary and affiliate 
companies are not responsible for errors or omissions in this e-mail message. 
Any personal comments made in this e-mail do not reflect the views of Blue 
Cross Blue Shield of Florida, Inc.  The information contained in this document 
may be confidential and intended solely for the use of the individual or entity 
to whom it is addressed.  This document may contain material that is privileged 
or protected from disclosure under applicable law.  If you are not the intended 
recipient or the individual responsible for delivering to the intended 
recipient, please (1) be advised that any use, dissemination, forwarding, or 
copying of this document IS STRICTLY PROHIBITED; and (2) notify sender 
immediately by telephone and destroy the document. THANK YOU.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to