You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by hu...@apache.org on 2003/05/24 13:27:16 UTC

cvs commit: jakarta-struts/doc/userGuide struts-bean.xml building_controller.xml

husted      2003/05/24 04:27:16

  Modified:    doc/userGuide struts-bean.xml building_controller.xml
  Log:
  Clarify bean:define and DynaActionForms.
  
  Revision  Changes    Path
  1.13      +8 -0      jakarta-struts/doc/userGuide/struts-bean.xml
  
  Index: struts-bean.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/doc/userGuide/struts-bean.xml,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- struts-bean.xml	10 May 2003 18:39:47 -0000	1.12
  +++ struts-bean.xml	24 May 2003 11:27:15 -0000	1.13
  @@ -167,6 +167,14 @@
       be able to use <code>&lt;bean:define&gt;</code> for the same bean
       name more than once in a single page.</p>
   
  +    <p><strong>USAGE NOTE</strong> - You cannot use bean:define to <b>instantiate</b>
  +    a DynaActionForm (type="org.apache.struts.action.DynaActionForm") with
  +    the properties specified in the struts-config. The mechanics of creating
  +    the dyna-properties is complex and cannot be handled by a no-argument
  +    constructor. If you need to create an ActionForm this way, you must use
  +    a conventional ActionForm.
  +    </p>
  +
       <p>See the Bean Developer's Guide section on
       <a href="../api/org/apache/struts/taglib/bean/package-summary.html#doc.Creation">
       bean creation</a> for more information about these differences, as well
  
  
  
  1.62      +16 -7     jakarta-struts/doc/userGuide/building_controller.xml
  
  Index: building_controller.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/doc/userGuide/building_controller.xml,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- building_controller.xml	24 May 2003 10:43:05 -0000	1.61
  +++ building_controller.xml	24 May 2003 11:27:15 -0000	1.62
  @@ -532,16 +532,25 @@
       </p>
       
       <p>
  -    In JSP pages using Struts custom tags (except bean:define), attributes of
  +    In JSP pages using the original Struts custom tags, attributes of
       <code>DynaActionForm</code> objects can be referenced just like ordinary
  -    <code>ActionForm</code> objects.  
  -    However, when utilizing the JavaServer Pages Standard Tag Library (JSTL), only
  -    properties of ordinary <code>ActionForm</code> objects can be directly 
  +    <code>ActionForm</code> objects. Wherever a Struts tag refers to a
  +    "property", the tags will automatically use the DynaActionForm properties
  +    just like those of a conventional JavaBean.
  +    You can even expose DynaActionForm properties using bean:define.
  +    (Although, tou can't use bean:define to <b>instantiate</b> a DynaActionForm,
  +    since it needs to be setup with the appropriate dyna-properties).
  +    </p>
  +
  +    <p>
  +    If you are using the Struts JSTL EL taglib, the references are different,
  +    however.
  +    Only properties of ordinary <code>ActionForm</code> objects can be directly
       accessed through the JSTL expression language syntax.  
  -    Although, <code>DynaActionForm</code> properties can be accessed through a
  +    The <code>DynaActionForm</code> properties must be accessed through a
       slightly different syntax. 
       The JSTL EL syntax for referencing a property
  -    of an <code>ActionForm</code> would be something like:
  +    of an <code>ActionForm</code> goes like this:
       </p>
       
   <pre><code>${formbean.prop}</code></pre>
  @@ -563,7 +572,7 @@
       DynaActionForms are meant as an easy solution to a common problem:
       <i>Your ActionForms use simple properties and standard validations,
       and you just pass these properties over to another JavaBean</i>
  -    (say using BeanUtils.copyProperties(<code>myBusinessBean,form)</code>).
  +    (say using <code>BeanUtils.copyProperties(myBusinessBean,form)</code>).
       </p>
   
       <p>
  
  
  

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