0

Is there a way to automate the validation framework usage in struts2.x. i mean automatically generate the validation xmls by looking at the form???

Dave Newton
  • 158,873
  • 26
  • 254
  • 302
tarun
  • 1

1 Answers1

1

Nutshell: no.

How would that even work? Without specifying explicit validation information, e.g., types, ranges, regex, etc. there's no metadata with which to magically guess what's "valid".

You could do something trivial in an interceptor by enforcing that all values must have some value.

You could use a naming convention, but that doesn't build an XML file as you're requesting.

You could use annotations, which also doesn't create an XML file.

It's unclear what problem you're actually trying to solve.

Dave Newton
  • 158,873
  • 26
  • 254
  • 302