File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Validation messages not displaying in order Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Struts
Reply Bookmark "Validation messages not displaying in order" Watch "Validation messages not displaying in order" New topic
Author

Validation messages not displaying in order

Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4695

I know that ActionErrors holds an ArrayList to keep track of messages, so the order they were added is maintained.

It seems that the validation framework is running validation checks listed from validation.xml in whatever order it darn well pleases.

Does anyone know of a way to control this?


A good workman is known by his tools.
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4695

Is the weather too nice out? Is everyone on vacation?
Gayatri Ganesh
Ranch Hand

Joined: Dec 23, 2003
Posts: 143
I think the framework uses a HashMap to store the errors.
If you could extract the errors from this HashMap into an ArrayList, i think you should be able to get the order.
not sure, you can try.
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4695

Is there any way to get the source of the Struts Validation framework???

Upon further testing, I was able to discover that my errors are getting listed by:
1) All textboxes, in reverse order of how they appear in the html
2) All radioboxes, in reverse order of how they appear in the html

Any additional help much appreciated! Thanks!
 
 
subject: Validation messages not displaying in order
 
Threads others viewed
Struts 2 - How do I remove validation messages from fields?
JSF validation - combining custom validator with tag validator
validation annotation in struts-2
Rearrange Order of Messages in FacesMessages
Problem with h:message. Someoone Please help
developer file tools