Interview Question: Do ActionForms have to be true JavaBeans?

By: Ash Printer Friendly Format    

Question: Do ActionForms have to be true JavaBeans?

Answer:

The utilities that Struts uses (Commons-BeanUtils since 1.1) require that ActionForm properties follow the JavaBean patterns for mutators and accessors (get*,set*,is*). Since Struts uses the Introspection API with the ActionForms, some containers may require that all the JavaBean patterns be followed, including declaring "implements Serializable" for each subclass. The safest thing is to review the JavaBean specification and follow all the prescribed patterns. Since Struts 1.1, you can also use DynaActionForms and mapped-backed forms, which are not true JavaBeans.

 

 

 

 

Ask a Question



Most Viewed Articles (in Interview )

Interview Question: What is ActionServlet?

Interview Question: What about JSTL and JavaServer Faces ?

Explain the different forms of Polymorphism.

Interview Question: Who makes the Struts?

Interview Question: Why it is called Struts?

Interview Question: What is Struts Validator Framework?

Interview Question: What is ActionForm?

Interview Question: Is Struts compatible with other Java technologies?

Interview Question: Does Struts include its own unit tests?

Interview Question: If the framework doesn't do what I want, can I request that a feature be added?

Interview Question: Is there a particularly good IDE to use with Struts ?

Interview Question: Why are some of the class and element names counter-intuitive?

Interview Question: What are the optional clauses in EJB QL?

Interview Question: What is difference between EJB 1.1 and EJB 2.0?

Interview Question: Is Decorator an EJB design pattern?

Latest Articles (in Interview)

Comment on this tutorial