Parameterized Constructors in form bean & action class of Struts Application

Question:- can I keep only parameterized constructiors in form bean & action class of Struts application?

Answer: Not possible, because programmer never creates objects for form bean, Struts Action classes. ActionServlet creates these objects by using zero argument constructors. If that is not available ActionServlet fails to create the objects of Strut’s Action class, form bean class.

Except spring container the remaining all container and framework s/w like Servlet container, EJB, Struts, JSF, and etc. generally use zero argument constructor to create object for the resources related classes.

Leave a Reply

Your email address will not be published. Required fields are marked *