"Struts in Action" on page 162 reads:
"You can use a DynaActionForm anywhere an ActionForm can be used. You can also
substitute a DynaActionForm for a conventional ActionForm without changing any of the
existing Java or JSP code."
I changed a ActionForm to a DynaActionForm by using the struts-config.xml:
<form-bean name="loginForm" type="org.apache.struts.action.DynaActionForm"
dynamic="true">
<form-property name="username" type="java.lang.String"/>
<form-property name="password" type="java.lang.String"/>
</form-bean>
I thought I would not have to change my existing code in the Action java code, but my
existing code did not work. I originally had:
String username = ((LoginForm)form).getUsername();
String password = ((LoginForm)form).getPassword();
The LoginForm was the form bean that I had created manually in java. I deleted the
LoginForm and replaced the form bean with a DynaActionForm as listed above. Of
course, once I no longer have a LoginForm.java file because it is a DynaActionForm,
this Action java code does not compile.
Therefore I see that I have to change my code in going from a manually coded form bean
to a DynaActionForm.
Am I missing something?
TIA
Mark