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 the purpose of form-beans tag in struct-config.xml?
Which design pattern the interceptors in struts2 is based on?
State an example of struts configuration file as an action parameter for action servlet.
Why was reload removed from struts (since 1.1)?
What is struts 2 framework in java?
What is the need of struts?
What is the purpose of @expressionvalidator annotation?
What are the reasons for an error message not being displayed while developing struts application?
How struts 2 validation works?
Can I have html form property without associated getter and setter formbean methods?
How you will enable front-end validation based on the xml in validation.xml?
What is an interceptor stack?
What are the core classes of struts?
What are action classes in struts?
What is the difference between empty default namespace and root namespace?