• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

use of first parameter in errors.add() method

 
Sameer Raza Ali
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the use of the first parameter in errors.add() method
 
jatan bhavsar
Ranch Hand
Posts: 299
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sameer,

Key represents the value from the form . suppose there is something wrong with the userid then you can set the action error like
"errors.add("userid",new ActionMessage("error.invalid.userid"));"

Refer This Link. Which will solve your doubt.

Regards
Jatan
 
Sameer Raza Ali
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jatan Thanks for your quick response i got your point the paragraph below gives the answer

You can also use to display a particular message based on the key used when it was added to the ActionErrors object. This is useful if you want to display the message next to the field causing the error.

Regards
Sameer
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic