Luis
Luis

Reputation: 341

Struts2 validation.xml and validate() method

I've got a struts2 validation.xml file to do some simple validation, but I need a more complex validation that requires taking data from database and checking it.

I'm doing it using validate() method from ActionSupport and it works fine. I just don't understand why when page gets back from validation the jsp page shows that validation form validation.xml has its own <ul> tag, and validation from validate() method has another one. There is some way to combine both?

Upvotes: 0

Views: 777

Answers (1)

Quaternion
Quaternion

Reputation: 10458

You can forgo the s:fielderror (or what ever error tag you're using) and use plain OGNL if you wish. Look at ActionSupport and you'll see getFieldErrors(), handle as you would a Map of Collections. Same methods can be applied for other errors.

Upvotes: 1

Related Questions