WebWork 2 : Component tag
This page last changed on Dec 14, 2004 by casey.
<ww:component />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_.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. Currently, your custom UI components must be written in Velocity.Remember: the value params will always be resolved against the OgnlValueStack so if you mean to pass a 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) Sample UsagesJSP <ww:component template="/my/custom/component.vm"/> or <ww:component template="/my/custom/component.vm"> <ww:param name="key1" value="value1"/> <ww:param name="key2" value="value2"/> </ww:component> Velocity #tag( Component "template=/my/custom/component.vm" ) or #bodytag( Component "template=/my/custom/component.vm" ) #param( "key1" "value1" ) #param( "key2" "value2" ) #end Attributes
|
![]() |
Document generated by Confluence on Dec 14, 2004 16:36 |