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 can we group related actions in one group in Struts?

555


What is role of action class?

558


What are the sections into which a strut configuration file can be divided?

544


Which interceptor is responsible for mapping request parameters to action class Java Bean properties?

556


How struts control data flow?

532






What is struts and springs in java?

524


Can we have multiple struts config files in a single web app?

497


What is struts2 namespace?

505


Difference between html tags and struts specific html tags

505


Why we use struts over servlets?

520


What is package name in struts xml?

551


List some bundled validators?

566


How many servlet controllers are used in a Struts Application?

509


Which configuration file is used for storing jsp configuration information in struts?

539


Is struts action class singleton?

544