Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use same rules for different ActionForms

 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have two ActionForm beans.I am specifying validation rules inside
validation.xml file.
Both beans are using same kind of rules.
Inside validation.xml file i am writing rules as shown below


//for bean 1
<formset >
<form name="ContentActionForm">
.....
<!--field property rules are same as bean 2-->
.....
</formset >

//for bean 2
<formset >
<form name="RegUserActionForm">
.....
<!--field property rules are same as bean 1-->
.....
</formset >

As show above i have specified same set of rules twice of two different
beans.
Is it not possible to attach different beans to same set of rules?
For example some thing like this
<form name="RegUserActionForm,ContentActionForm">
or
<form name="RegUserActionForm","ContentActionForm">

Thanks
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately, I don't know of a way to reuse validation rules set up for one form for another. In my mind that has always been one of the weaknesses of the validation framework.
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Once again I completely agree with Merrill's post. Sometimes I think it is easier and cleaner just to implement the validate method.

- Brent
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic