WebWork 2 : Common Tags
This page last changed on Nov 29, 2004 by jcarreira.
ParamSets a parameter for the parent tag. Examples include ww:url and ww:action.<ww:action name="VelocityCounter" id="vc"> <ww:param name="foo" value="'BAR'"/> </ww:action> javascript:popUp('<ww:url value="wiki.opensymphony.com/exec/edit"><ww:param name="name" value="Common Tags"/></ww:url>') from webwork.tld: <attribute> <name>name</name> <required>true</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>value</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> PropertyUsed to get the value of a result attribute. If the value isn't given, the top of the stack will be returned.<ww:property value="id" default="#session[OS:'customer'].id"/> From webwork.tld: <attribute> <name>value</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>default</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> PushUsing ww:push, you can add an object of your choice to the top of the value stack. This is similar to what you can do with ww:set (see below), so read both before deciding which to use.<ww:push value="counter"> <ww:property value="count"/> </ww:push> To make an action available on the stack: <ww:action name="'SomeAction'" id="sa"/> <ww:push value="#sa"> foo = <ww:property value="foo"/> </ww:push> from webwork.tld: <attribute> <name>value</name> <required>true</required> <rtexprvalue>true</rtexprvalue> </attribute> SetYou can create your own named variables from within a JSP using the ww:set tag. Reference your variable later using the #variableName notation.<ww:set name="huba" value="foo.bar" scope="webwork" /> <ww:property value="#huba.otherExpression().baz"/>) from webwork.tld: <info> Sets the value of an object in the VS to a scope (page, stack, application, session). If the value is not given, the top of the stack is used. If the scope is not given, the default scope of "webwork" is used. </info> <attribute> <name>name</name> <required>true</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>value</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>scope</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> UrlThis tag builds an encoded Url. The simplest version of the tag, <ww:url/>, outputs the relative url of the current page. Here is example output from such a tag:/jsp/cart.jsp?template=%5BLjava.lang.String%3B%40e29f36&id=%5BLjava.lang.String%3B%40429be9 Here is a more verbose example: <ww:url value="www.google.com/search"> <ww:param name="sourceid" value="'navclient'"/> <ww:param name="ie" value="'UTF-8'"/> <ww:param name="oe" value="'UTF-8'"/> <ww:param name="q" value="'webwork'"/> </ww:url> and the resulting output: http://www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=webwork from webwork.tld: <attribute> <name>value</name> <required>false</required> <rtexprvalue>false</rtexprvalue> </attribute> <attribute> <name>id</name> <required>false</required> <rtexprvalue>false</rtexprvalue> </attribute> |
![]() |
Document generated by Confluence on Dec 14, 2004 16:36 |