Answer Posted / biru
In Validate method for each validation error we need to
construct an object of ActionMessage class and we need to
add each ActionMessage class object to ActionErrors class
object .
Ex:
public ActionErrors validate(ActionMapping
am,HttpServletRequest)
{
ActionErrors aes=new ActionErrors();
if(uname.length==0)
{ ActionMessage am1=new ActionMessage("uname.wrong")
aes.add("uname",am1);
}
}
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What is validate() and reset() functions?
What is xml based validation in struts2?
What are the benefits of Interceptors in Struts2?
How you will enable front-end validation based on the xml in validation.xml?
What is the purpose of @action annotation?
What do you mean by tiles in struts?
How to handle exceptions in structs?
Why do the struts tags provide for so little formatting?
Does apache tomcat use struts?
How can we display all validation errors to user on jsp page?
Difference between html tags and struts specific html tags
How does struts work?
In struts.xml, what does the attribute "method" stands for in the "action" tag?
What is the design role played by struts?
What is dispatchaction?