• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

count errors in jsp using validation framwork

 
hari om
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use Global.ERRORKEY to get the name of the parameter which saves the Error object.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic