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

what are tiles in struts?

3 Answers   Wipro,


What is the default suffix for struts2 action uri ?

0 Answers  


What is the use of interceptor?

0 Answers  


What are the aware interfaces in struts2?

0 Answers  


What is includeaction?

0 Answers  


How action mapping is configured in Struts?

0 Answers  


What is the difference between Jakarta Struts and Apache Struts? Which one is better to use?

0 Answers  


what is frame work in struts?

3 Answers   Infosys,


Who wrote struts?

0 Answers  


What are the differences between Struts1 and Struts2 or how Struts2 is better than Struts1?

0 Answers  


What does action do in struts?

0 Answers  


what are the type of forward class in Struts?

5 Answers   Wipro,


Categories