I am having trouble getting validator to work for a form bean that's shared by different pages. The way I have it set up is as follows:
1) I have a DynaValidatorForm named "searchForm". The form bean has 8 properties.
2)The form bean is used by 5 different JSP search pages, each for different search type. Each of the 5 JSP search pages uses some of the 8 properties, but none of them use all 8.
3) All 5 JSP search pages use the same action, and each JSP search page has a hidden "searchType" variable which determines the type of the search.
4) For each type, the action fetches form data needed for the particular search type. If it uses 3 of the 8 form bean properties, only those 3 are used.
So far it looks like if I make the form bean properties exactly same as the properties used on a search page, the valdiator works. For example, if a search page uses 4 of the 8 properties, commenting out the 4 unused properties in the Struts config make the valdiator work, or alternatively, adding 4 hidden form fields for those unused form properties to the page.
Is there a better way to get validator to work for this kind of setup?
Thanks in advance for your help.
[ April 21, 2008: Message edited by: Wilson Gordon ]