aspose file tools*
The moose likes Struts and the fly likes Typical/Built-in way to do validate different sets of parameters? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Typical/Built-in way to do validate different sets of parameters?" Watch "Typical/Built-in way to do validate different sets of parameters?" New topic
Author

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

Brett Han
Greenhorn

Joined: May 17, 2005
Posts: 10
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Typical/Built-in way to do validate different sets of parameters?