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 the conditions for actionform to work correctly?

1 Answers  


Why struts 1 classes are not thread safe whereas struts 2 classes are thread safe?

1 Answers  


What is the purpose of form-be tag in struct-config.xml?

1 Answers  


How is the Struts framworl related to MVC2?

2 Answers   Wipro,


how to implement singletun design patteren in struts?

5 Answers   HCL,


Which library is provided by struts for form elements like check boxes, text boxes etc?

1 Answers  


In which order struts framework searches for a message bundle?

1 Answers  


Why it called struts?

1 Answers  


How to use dispatchaction?

1 Answers  


What is the use of token interceptor in Struts2?

1 Answers  


What is struts in java with example?

1 Answers  


How to convert struts to spring mvc?

1 Answers  


Categories