• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Typical/Built-in way to do validate different sets of parameters?

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm hoping this is a common struts problem as well.

I have a Struts form that users can use to generate reports, based on data they input. The problem is that they can input different sets of data.

For example, assume the form contains fields A through F.

The following may be valid input sets:

1. A, B, and C
2. Just D
3. A, D, and E
4. B and F

and so on.

So the user must enter non-null values - and sometimes more constrained values like integers - for one of the given sets above. So if he only entered values in, say, C, E, and F, I should display an error.

and so on.

I could write error-checking rules either in the associated action or in the validate method on the form bean, but this is already getting really messy and more inputs could be added later on.

Is there a common way in struts to deal with validation on different input sets like this? Thanks.
reply
    Bookmark Topic Watch Topic
  • New Topic