commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Jakarta-commons Wiki] Trivial Update of "ValidatorSetup" by AndyJacobs
Date Mon, 19 Feb 2007 15:28:00 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jakarta-commons Wiki" for change notification.

The following page has been changed by AndyJacobs:
http://wiki.apache.org/jakarta-commons/ValidatorSetup

------------------------------------------------------------------------------
  }}}
     * create the form configuration in struts-config.xml for the form-names, e.g. for ValidatorForms:
  {{{
-         <form-bean name="sectionForm"
+         <form-bean name="surveyForm"
            type="com.mystuff.myapp.myForm">
          </form-bean>
  }}}
     * or for DynaValidatorForms (we have to specify the fields we want here - and it's best
to stick to Strings rather than trying to deal with Integers or Dates etc which do not get
populated if the user enters the wrong type of data):
  {{{
-         <form-bean name="sectionForm"
+         <form-bean name="surveyForm"
            type="org.apache.struts.validator.DynaValidatorForm">
-           <form-property name="sectionId"
+           <form-property name="surveyForm"
              type="java.lang.String"/>
            <form-property name="title"
              type="java.lang.String"/>
@@ -134, +134 @@

  
   1. It goes and checks for any instances of the form-bean in the scope (the name of the
class, type, and scope is specified by the action mapping in struts-config.xml).
  
-  1. If found then call the form's reset method
+  1. If found then call the form's reset method is called.
  
   1. If not found than a new instance is created and stored in the proper scope.
  
@@ -148, +148 @@

  
  Then after that you have a populated form. Normally you would then transfer the data into
a value or data-transfer object to pass to your business layer (see BeanUtils.copyProperties).
  
- 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message