Dynamic Validation in Struts with DynaValidatorForms

D

D. Mantelos

1. In my struts-config.xml I use a form bean of type DynaValidatorForm
with some properties.
2. In the validator.xml I defined these fields as required.
3. I DO NOT WANT TO WRITE ANY ACTIONFORM CLASS

Is it possible to define dynamic Form beans in the struts-config.xml
without creating explicitly a Form class?

TIA
 
W

Wendy S

D. Mantelos said:
1. In my struts-config.xml I use a form bean of type DynaValidatorForm
with some properties.
2. In the validator.xml I defined these fields as required.
3. I DO NOT WANT TO WRITE ANY ACTIONFORM CLASS

Is it possible to define dynamic Form beans in the struts-config.xml
without creating explicitly a Form class?

If none of your fields is a checkbox (so that you would need a reset method)
then you might be able to get away without a form class. You might need
some additional mappings so that you can avoid validating the first time the
form is displayed, etc., but yes, it should be possible.

(Assuming you're writing an Action class, why are you so opposed to a Form
class? Dynamic forms really only get you out of writing all those get/set
methods, there are plenty of reasons you might write a form class that
extends DynaValidatorForm.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,267
Latest member
WaylonCogb

Latest Threads

Top