You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by la...@apache.org on 2005/11/27 06:44:31 UTC
svn commit: r349183 -
/struts/action/trunk/xdocs/userGuide/building_controller.xml
Author: laurieh
Date: Sat Nov 26 21:44:27 2005
New Revision: 349183
URL: http://svn.apache.org/viewcvs?rev=349183&view=rev
Log:
Updating DynaActionForm section to reflect that the enhanced dyan bean
form behaviour is now optional.
Modified:
struts/action/trunk/xdocs/userGuide/building_controller.xml
Modified: struts/action/trunk/xdocs/userGuide/building_controller.xml
URL: http://svn.apache.org/viewcvs/struts/action/trunk/xdocs/userGuide/building_controller.xml?rev=349183&r1=349182&r2=349183&view=diff
==============================================================================
--- struts/action/trunk/xdocs/userGuide/building_controller.xml (original)
+++ struts/action/trunk/xdocs/userGuide/building_controller.xml Sat Nov 26 21:44:27 2005
@@ -676,31 +676,52 @@
</p>
<p>
- Since release 1.3.0, JSTL EL works with DynaActionForm properties just
- like with ordinary ActionForm objects. For example, you can use an
- expression like this:
+ If you are using the Struts JSTL EL taglib, the references are, by default,
+ different. Only properties of ordinary ActionForm objects can be directly
+ accessed through the JSTL expression language syntax. The DynaActionForm
+ properties must be accessed through a slightly different syntax. The
+ JSTL EL syntax for referencing a property of an ActionForm goes like this:
</p>
-<source>${formbean.prop}</source>
+ <source>${formbean.prop}</source>
<p>
- Prior to 1.3.0, the references are different, however.
- Only properties of ordinary ActionForm objects can be directly
- accessed through the JSTL expression language syntax.
- The DynaActionForm properties must be accessed through a
- slightly different syntax.
- The JSTL EL syntax for referencing a property
- of a DynaActionForm in Struts 1.2.x and earlier goes like this:
+ The syntax for referencing a property of a DynaActionForm would be:
</p>
-<source>${dynabean.map.prop}</source>
+ <source>${dynabean.map.prop}</source>
<p>
- The map property is a property of
- DynaActionForm which represents the HashMap
- containing the DynaActionForm properties.
- In Struts 1.3.0 and later, this syntax is still
- supported, but is no longer required.
+ The map property is a property of DynaActionForm which represents the
+ HashMap containing the DynaActionForm properties.
+ </p>
+
+ <p>
+ Since release 1.3.0 it is possible to use regular JSTL EL property
+ references, without the additional '.map' qualifier. This can be
+ useful if you often reference form bean properties with JSTL or if
+ you need to pass form beans to JSP 2.0 tag files or other re-usable
+ components which shouldn't need to know how to handle DynaActionForm
+ objects specially.
+ </p>
+
+ <p>
+ To make this work, you need to do two things:
+ <ul>
+ <li>install <a href="http://cglib.sourceforge.net/">CGLIB</a>
+ in your application's classpath</li>
+ <li>include the 'enhanced="true"' attribute in the form-bean
+ declaration in struts-config.xml, like this:
+
+ <source><![CDATA[
+<form-bean name="myForm" enhanced="true"
+ type="org.apache.struts.action.DynaActionFrom">
+ ...
+</form-bean>]]></source>
+ </li>
+ </ul>
+ You can then reference DynaFormBean properties just like any other
+ ActionForm.
</p>
<p>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org