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 struts2 error message keys that can come during file uploading process?

0 Answers  


When should we use SwtichAction?

0 Answers  


How struts 2 validation works?

0 Answers  


What is the purpose of @urlvalidator annotation?

0 Answers  


What is the difference between session scope and request scope when saving formbean ?

0 Answers  






How to get data from the velocity page in a action class?

0 Answers  


Where can i get jar file for use the struts-tags in struts2?

2 Answers  


what is request processor class ?

10 Answers   Fidelity,


If the framework doesn’t do what I want, can I request that a feature be added?

0 Answers  


What is the different actions available in struts?

0 Answers  


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

0 Answers  


how to create a search field in struts.with code

3 Answers   Infosys, Satyam,


Categories