In this chapter,We will learn How to working with Dynamic Properties.Working with Dynamic Properties is very easy.You can used DynaValidatorForm class instead of the DynaActionForm class.
Change Struts-config.xml files :
<form-beans>
<form-bean name="userForm" type="org.apache.struts.validator.DynaValidatorForm" >
<form-property name="userName" type="java.lang.String" />
<form-property name="registrationno" type="java.lang.String" />
</form-bean>
</form-beans>
struts-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
"http://struts.apache.org/dtds/struts-config_1_3.dtd">
<struts-config>
<form-beans>
<form-bean name="userForm" type="org.apache.struts.validator.DynaValidatorForm" >
<form-property name="userName" type="java.lang.String" />
<form-property name="registrationno" type="java.lang.String" />
</form-bean>
</form-beans>
<global-exceptions />
<global-forwards>
<forward name="welcomeAction" path="/welcomeAction.do"/>
</global-forwards>
<action-mappings>
<action path="/welcomeAction" type="com.r4r.struts.WelcomeAction" name="welcomeForm">
<forward name="success" path="/success.jsp"/>
</action>
</action-mappings>
<message-resources parameter="com.r4r.struts.ApplicationResources" />
</struts-config>