What is the use of ActionErrors in Struts



What is the use of ActionErrors in Struts..

Answer / 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

More Struts Interview Questions

Who makes the struts?

0 Answers  


How do I access token?

0 Answers  


Are interceptors thread safe?

0 Answers  


What is the purpose of @results?

0 Answers  


Name some of the features of struts2?

0 Answers  






What are the action classes in struts?

0 Answers  


In which method of action class the business logic is executed?

0 Answers  


What is package name in struts xml?

0 Answers  


How an actionform bean is created?

0 Answers  


what are the componenets of struts?

8 Answers   HCL,


What is the default suffix for Struts2 action URI and how can we change it?

0 Answers  


What is the flow of requests in struts based applications?

0 Answers  


Categories