Author: tmjee Date: Fri Jun 16 00:53:20 2006 New Revision: 414772 URL: http://svn.apache.org/viewvc?rev=414772&view=rev Log: WW-1340 - updated javadoc to correct ambiguities pointed out by Jennifer (see http://forums.opensymphony.com/thread.jspa?threadID=33869&tstart=0) - updated javadoc to separate out Freemarker and JSP usage.
Modified: struts/action2/trunk/core/src/main/java/org/apache/struts/action2/components/GenericUIBean.java Modified: struts/action2/trunk/core/src/main/java/org/apache/struts/action2/components/GenericUIBean.java URL: http://svn.apache.org/viewvc/struts/action2/trunk/core/src/main/java/org/apache/struts/action2/components/GenericUIBean.java?rev=414772&r1=414771&r2=414772&view=diff ============================================================================== --- struts/action2/trunk/core/src/main/java/org/apache/struts/action2/components/GenericUIBean.java (original) +++ struts/action2/trunk/core/src/main/java/org/apache/struts/action2/components/GenericUIBean.java Fri Jun 16 00:53:20 2006 @@ -25,12 +25,26 @@ /** * <!-- START SNIPPET: javadoc --> + * * Renders an custom UI widget using the specified templates. Additional objects can be passed in to the template - * using the param tags. Objects provided can be retrieve from within the template via $parameters._paramname_.<p/> + * using the param tags.<p/> + * + * <b>Freemarker:</b><p/> + * Objects provided can be retrieve from within the template via $parameters._paramname_.<p/> + * + * <b>Jsp:</b><p/> + * Objects provided can be retrieve from within the template via <saf:property value="%{parameters._paramname_}" /><p/> + * * * In the bottom JSP and Velocity samples, two parameters are being passed in to the component. From within the - * component, they can be accessed as $parameters.get('key1') and $parameters.get('key2'). Velocity also allows - * you reference them as $parameters.key1 and $parameters.key2.<p/> + * component, they can be accessed as:- <p/> + * + * <b>Freemarker:</b><p/> + * $parameters.get('key1') and $parameters.get('key2') or $parameters.key1 and $parameters.key2<p/> + * + * <b>Jsp:</b><p/> + * <saf:property value="%{parameters.key1}" /> and <saf:property value="%{'parameters.key2'}" /> or + * <saf:property value="%{parameters.get('key1')}" /> and <saf:property value="%{parameters.get('key2')}" /><p/> * * Currently, your custom UI components can be written in Velocity, JSP, or Freemarker, and the correct rendering * engine will be found based on file extension.<p/> @@ -39,6 +53,7 @@ * string literal to your component, make sure to wrap it in quotes i.e. value="'value1'" otherwise, the the value * stack will search for an Object on the stack with a method of getValue1(). (now that i've written this, i'm not * entirely sure this is the case. i should verify this manana)<p/> + * * <!-- END SNIPPET: javadoc --> * * <p/> <b>Examples</b> @@ -71,8 +86,8 @@ * or * * <@saf.component template="/my/custom/component.ftl"> - * <@saf.param name="key1" value="value1" /> - * <@saf.param name="key2" value="value2" /> + * <@saf.param name="key1" value="%{'value1'}" /> + * <@saf.param name="key2" value="%{'value2'}" /> * </@saf.component> * * <!-- END SNIPPET: example -->