wood burning stoves 2.0*
The moose likes Struts and the fly likes count errors  in jsp using validation framwork Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "count errors  in jsp using validation framwork" Watch "count errors  in jsp using validation framwork" New topic
Author

count errors in jsp using validation framwork

hari om
Greenhorn

Joined: Jan 22, 2008
Posts: 2
hi,
I have some 20 fields in my jsp form and I am throwing errors using validation framework's server side validation,
I need to count the no. of errors which will be thrown every time.
Nadda Habba
Greenhorn

Joined: Feb 16, 2005
Posts: 18
All the failed validations will have a corresponging error object in the Errors collection, size method would give the no of error objects and also failed validations.
hari om
Greenhorn

Joined: Jan 22, 2008
Posts: 2
hi
Thanks for the quick replay, but can you give me some code snippet as because I am not using any Actionerrors in my action class I am using only <html:errors/> in my jsp to display errors with the help of validation.xml and properties file.
Nadda Habba
Greenhorn

Joined: Feb 16, 2005
Posts: 18
you could use TagUtilities and get the ErrorMessages stored in the session. You could then display the count on the jsp page. hope this helps
Nadda Habba
Greenhorn

Joined: Feb 16, 2005
Posts: 18
use Global.ERRORKEY to get the name of the parameter which saves the Error object.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: count errors in jsp using validation framwork
 
Similar Threads
Choosing frameworks etc...
Struts + Error Message Display
error information using javascript
Displaying error in multi page form.
How to find out which form generated errors ?