What is the use of ActionErrors in Struts

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


Please Help Members By Posting Answers For Below Questions

How many action classes can be used in struts application?

707


Describe the mvc on struts?

716


Explain architecture of struts2?

805


What are the reasons for an error message not being displayed while developing struts application?

721


What are best practices to follow while developing Struts2 application?

784


Explain about how requests from the client are sent?

676


How client side validation is enabled on a jsp form?

760


What is the difference between struts and spring?

687


What is http forward?

719


What is the differences between struts1 and struts2?

695


What is the difference between empty default namespace and root namespace?

785


What is the purpose of struts.xml in struct2?

845


Explain about the tag?

828


What are the core classes of struts framework? Explain

735


What are action errors and error?

775