Interview Question: Do ActionForms have to be true JavaBeans?

By: Ash  

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.

 

 

 

 



Most Viewed Articles (in Interview )

What are implicit Objects available to the JSP Page?

Interview Question: Where can I get help with Struts?

Interview Question: Why aren't the Struts tags maintained as part of the Jakarta Taglibs project ?

Interview Question: What is ActionServlet?

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

Interview Question: What about JSTL and JavaServer Faces ?

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?

What do you understand by JSP Actions?

Explain the new Features of JDBC 2.0 Core API?

What is difference between Java Bean and Enterprise Java Bean?

How to define an Abstract class?

Interview Question: Does Struts include its own unit tests?

What is similarities/difference between an Abstract class and Interface?

What do you understand by a container?

Latest Articles (in Interview)

Comment on this tutorial