WebWork's Custom Tags
A quick reference for WebWork's (WW) Custom JSP tags.
Non-UI Custom Tags
A set of Non-UI tags developed to perform a variety of tasks from invoking WW Actions, conditional branching, internationalization, to encoding and displaying an URL.
action tag
Action tag provides another method to call Actions. This is an alternative way to invoke an action besides calling an url; i.e. - *.action that would be sent to the ServletDispatcher.
Attributes
| attribute | requied |
| id | F |
| name | T |
In this example, the ClientInfo action will be executed and its methods will be used to retrieve information and perform a conditional test.
<webwork:action name="'ClientInfo'">
Browser:<webwork:property value="browser"/><br>
Version:<webwork:property value="version"/><br>
Supports GIF:
<webwork:if test="supportsType('image/gif') == true">Yes</webwork:if>
<webwork:else>No</webwork:else>
<br>
</webwork:action>
append tag
Append will append a list of iterators. The values of the iterators will be appended and treated as one iterator. The outputs from the iterator will be in the sequence the sources were added.
Attributes
| attribute | requied |
| id | F |
In this example, the two iterators @values and @spaces are appended. This means @spaces values are after @values.
<h1>Testing append, subset, and value generators</h1>
<table border="1">
<webwork:bean name="'webwork.util.Counter'">
<webwork:param name="'last'" value="5"/>
<webwork:iterator id="colcount">
<tr>
<iterator:generator val="'foo,bar,xyzzy'" separator="','" count="@colcount" id="values"/>
<iterator:generator val="' '" count="-1" id="space"/>
<iterator:append>
<webwork:param name="'source'" value="@values"/>
<webwork:param name="'source'" value="@space"/>
<iterator:subset count="6">
<webwork:iterator>
<td width="40"><webwork:property/></td>
</webwork:iterator>
</iterator:subset>
</iterator:append>
</tr>
</webwork:iterator>
</webwork:bean>
</table>
bean tag
Used to instantiate a bean that can be used to access functionality.
Attributes
| attribute | requied |
| id | F |
| name | T |
In this example, Counter is used as a bean. We can now call the methods we desire. In this case, we setFirst() to first birth year which is 1975 and we setLast() to 2000. We then display a combo box using Counter as an Iterator.
<webwork:bean name="'webwork.util.Counter'" id="year">
<webwork:param name="'first'" value="text('firstBirthYear')"/>
<webwork:param name="'last'" value="2000"/>
<ui:combobox label="'Birth year'" size="6" maxlength="4" name="'birthYear'" list="@year"/>
</webwork:bean>
else tag
Used to determine if the preceding statement was false.
Attributes
| attribute | requied |
| id | F |
In this exmaple, else will evaluate its body since both if and elseIf conditions are false.
<webwork:if test="true == false"> <b>if: Failures</b> </webwork:if> <webwork:elseIf test="true == false"> <b>elseIf: Failure</b> </webwork:elseIf> <webwork:else> <b>else: Success</b> </webwork:else>
elseif tag
Used to determine if a statement is true or false after a previous test.
Attributes
| attribute | requied |
| id | F |
| test | T |
In this example, elseIf will evaluate its body since its test condition is true and if is false.
<webwork:if test="true == false"> <b>if: Failures</b> </webwork:if> <webwork:elseIf test="true == true"> <b>elseIf: Success</b> </webwork:elseIf> <webwork:else> <b>else: Failure</b> </webwork:else>
generator tag
Generate will create Iterators from val.
Attributes
| attribute | requied |
| id | F |
| count | F |
| separator | F |
| val | T |
In this example, two Iterators are created. One for val="'foo,bar,xyzzy'" and the other for val="' '".
<h1>Testing append, subset, and value generators</h1>
<table border="1">
<webwork:bean name="'webwork.util.Counter'">
<webwork:param name="'last'" value="5"/>
<webwork:iterator id="colcount">
<tr>
<pre>************************************************************
Generator will create an Iterator that has 5 items.
The first 3 are "foo,bar,xyzzy". Item 4 and 5 will be
foo and bar respectively. If the count is more than
the items, you start over.
************************************************************
<iterator:generator val="'foo,bar,xyzzy'" separator="','" count="@colcount" id="values"/>
************************************************************
Generator will create an Iterator that has infinite
. Count=-1 means indefinite.
************************************************************
<iterator:generator val="' '" count="-1" id="space"/>
<iterator:append>
<webwork:param name="'source'" value="@values"/>
<webwork:param name="'source'" value="@space"/>
<iterator:subset count="6">
<webwork:iterator>
<td width="40"><webwork:property/></td>
</webwork:iterator>
</iterator:subset>
</iterator:append>
</tr>
</webwork:iterator>
</webwork:bean>
</table>
if tag
Used to determine if a statement is true or false.
Attributes
| attribute | requied |
| id | F |
| test | T |
In this example, if will evaluate its body since the test condition is true. elseIf and else will not evaluate.
<webwork:if test="true == true"> <b>if: Success</b> </webwork:if> <webwork:elseIf test="true == true"> <b>elseIf: Failure</b> </webwork:elseIf> <webwork:else> <b>else: Failure</b> </webwork:else>
include tag
Used to include another page or action.
Attributes
| attribute | requied |
| page | F |
| value | F |
In this example, beaninfo.jsp will introspec on people[0] which is a Person. Take a look at beaninfo.jsp example and notice how it retrieves the parent value off the ValueStack with "..".
<webwork:property value="people[0]"> <webwork:include value="'beaninfo.jsp'"/> </webwork:property>
In this example, an Action is invoked.
<h1>RSS viewer</h1> <webwork:include value="'rss.viewer.action'"/>
iterator tag
Iterator will iterate over a value. An iterable value can be either of: java.util.Collection, java.util.Iterator, java.util.Enumeration, java.util.Map, array, XML Node, or XML NodeList.
Attributes
| attribute | requied |
| id | F |
| status | F |
| value | F |
In this example, iterator will iterate over Counter. property will output the current value which is 1 through 10.
<webwork:bean name="'webwork.util.Counter'">
<webwork:param name="'last'" value="10"/>
<webwork:iterator>
<webwork:property/><br />
</webwork:iterator>
</webwork:bean>
In this example, we use a couple of IteratorStatus to see where we are within iterations.
<h1>Testing iterator status</h1>
<webwork:bean name="'webwork.util.Counter'" id="rowcounter">
<webwork:param name="'first'" value="0"/>
<webwork:param name="'last'" value="5"/>
</webwork:bean>
<table border="1">
<webwork:iterator value="@rowcounter" status="'rowstatus'">
<tr>
<pre><webwork:bean name="'webwork.util.Counter'" id="colcounter">
<webwork:param name="'first'" value="0"/>
<webwork:param name="'last'" value="5"/>
</webwork:bean>
<webwork:iterator value="@colcounter" status="'colstatus'">
************************************************************
if it is (first row) or (first column) or (last row) then
output the column number.
************************************************************
<webwork:if test="@rowstatus/first==true || @colstatus/first==true || @rowstatus/last==true">
<th><webwork:property value="@colstatus/count"/></th>
</webwork:if>
<webwork:else>
<td><webwork:property/></td>
</webwork:else>
</webwork:iterator>
</tr>
</webwork:iterator>
</table>
Here we use the IteratorStatus determine every other row to insert an extra line break. This is very useful for shading alternate rows in an HTML table. Both even and odd attributes are available.
<webwork:iterator status="'status'"> <webwork:if test="@status/odd == true"> <br /> </webwork:if> <br /> </webwork:iterator>
Here we use the IteratorStatus determine every fourth row to insert an extra line break.
<webwork:iterator status="'status'"> <webwork:if test="@status/modulus(4) == 0"> <br /> </webwork:if> <br /> </webwork:iterator>
i18n tag
Place a resource bundle on the value stack for access by the text tag.
Attributes
| attribute | requied |
| name | T |
In this example, we load Shop resource bundle and text tag retrieves 'main.title'.
4) Accessing messages from a given bundle (the i18n Shop example bundle in this case)<br> <webwork:i18n name="'webwork.action.test.i18n.Shop'"> <webwork:text name="'main.title'"/> </webwork:i18n>
merge tag
Merge several iterators into one. It weaves them together. If one iterator runs out, it will drop off and the others will continue weaving until there are no more values.
Attributes
| attribute | requied |
| id | F |
In this example, @foo, @bar, and @xyzzy iterators are merged together. So, the output will be foo, bar, xyzzy until @foo and @xyzzy iterators run out in which case @bar will finish.
Three value generators with merge and subset limits:<br>
<iterator:generator val="'foo'" count="5" id="foo"/>
<iterator:generator val="'bar'" count="10" id="bar"/>
<iterator:generator val="'xyzzy'" count="5" id="xyzzy"/>
<iterator:merge>
<webwork:param name="'source'" value="@foo"/>
<webwork:param name="'source'" value="@bar"/>
<webwork:param name="'source'" value="@xyzzy"/>
<iterator:subset count="30">
<webwork:iterator status="'status'">
<webwork:property value="@status/count"/>:<webwork:property/><br>
</webwork:iterator>
</iterator:subset>
</iterator:merge>
param tag
Allows you to add parameters to tags that support adding parametric tags. You can place param tags within the body of parametric supporting tags and param will add its parameter to its parent.
Attributes
| attribute | requied |
| value | F |
| name | F |
In this example, each param will add its parameter to Counter. This means param will call Counter's appropriate setter method.
<webwork:bean name="'webwork.util.Counter'" id="year">
<webwork:param name="'first'" value="text('firstBirthYear')"/>
<webwork:param name="'last'" value="2000"/>
<ui:combobox label="'Birth year'" size="6" maxlength="4" name="'birthYear'" list="@year"/>
</webwork:bean>
The property tag has three distinct use cases:
- fetching a value and printing it
- putting a value on the top of the value stack during the execution of its body
- setting a value as an attribute in the pageContext
Some examples will illustrate these different uses:
Print getX().getY()
<webwork:property value="x/y">Print what's on the top of the value stack
<webwork:property/></webwork:property>This works because the default for the value attibute is "." (the object on top of the stack). It can be very useful to debug where you are on the stack, often printing out the toString() method of your action.
Using the second example above makes your code easier to read:
<webwork:property value="someUser">
<webwork:property value="name" /><br>
<webwork:property value="fullName" /><br>
<webwork:property value="email" /><br>
</webwork:property>
This will print out the attributes (getName, getFullName(), getEmail()) of the user object obtained from getSomeUser().
The alternative is much more difficult to read, and potentially slower:
<webwork:property value="someUser/name" /><br> <webwork:property value="someUser/fullName" /><br> <webwork:property value="someUser/email" /><br>Potentially slower? Yes - because the first code snippet only calls getSomeUser() once - whereas the second makes 3 calls to getSomeUser() - so your user lookup might be done 3 times.
Using the property tag to set an attribute:
<webwork:property id="user" value="someUser"/>
This is equivalent to calling pageContext.setAttribute("user", getSomeUser()), making the someUser object available throughout the rest of the page via the EL as "@user". Note that this usage works whether or not the property tag has a body, but without a body, using the id attribure will prevent the property from printing.
When using the property tag to print (usecase one above), HTML characters will be escaped by default, whereas the contents of property tags with bodies will not be escaped. This behavior can be overridden by explicitly setting the escape attribute. Quoted text that is escaped will have its outer quotes stripped.
Note also that if the property tag has an empty body, it behaves the same as having no body and prints the value, though both spaces and carriage returns constitute nonempty content.
Attributes
| attribute | required |
| id | F |
| value | F |
| escape | F |
sort tag
Sort allows you to sort an iterator. It uses Collections.sort() given the comparator you supply.
Attributes
| attribute | requied |
| id | F |
| comparator | T |
| source | F |
In this example, we sort ascending.
<webwork:bean name="'webwork.util.Counter'" id="counter">
<webwork:param name="'first'" value="0"/>
<webwork:param name="'last'" value="5"/>
</webwork:bean>
<webwork:bean name="'webwork.util.Sorter'" id="sorter"/>
Ascending:<br />
<iterator:sort source="@counter" comparator="@sorter/ascending">
<webwork:iterator>
<webwork:property/><br />
</webwork:iterator>
</iterator:sort>
In this example, we sort descending.
<webwork:bean name="'webwork.util.Sorter'" id="sorter"/>
<webwork:bean name="'webwork.util.Counter'" id="counter">
<webwork:param name="'first'" value="0"/>
<webwork:param name="'last'" value="5"/>
</webwork:bean>
Descending:<br>
<iterator:sort source="@counter" comparator="@sorter/descending">
<webwork:iterator>
<webwork:property/><br>
</webwork:iterator>
</iterator:sort>
In this example, we sort ascending over strings.
<webwork:bean name="'webwork.util.Sorter'" id="sorter"/>
Sorting strings:<br>
<iterator:generator val="'Rickard,Maurice,Hristo'" separator="','" id="names"/>
<iterator:sort source="@names" comparator="@sorter/ascending">
<webwork:iterator>
<webwork:property/><br>
</webwork:iterator>
</iterator:sort>
subset tag
Subset will iterate over a portion of its source. It will start at start and continue for count. You can set count to -1 if you want to iterate until the end of source. If you do not supply a source, the current object on the ValueStack- "." will be used.
Attributes
| attribute | requied |
| id | F |
| count | F |
| source | F |
| start | F |
In this example, subset will iterate over 6 items for the current object in the ValueStack.
<h1>Testing append, subset, and value generators</h1>
<table border="1">
<webwork:bean name="'webwork.util.Counter'">
<webwork:param name="'last'" value="5"/>
<webwork:iterator id="colcount">
<tr>
<iterator:generator val="'foo,bar,xyzzy'" separator="','" count="@colcount" id="values"/>
<iterator:generator val="' '" count="-1" id="space"/>
<iterator:append>
<webwork:param name="'source'" value="@values"/>
<webwork:param name="'source'" value="@space"/>
<iterator:subset count="6">
<webwork:iterator>
<td width="40"><webwork:property/></td>
</webwork:iterator>
</iterator:subset>
</iterator:append>
</tr>
</webwork:iterator>
</webwork:bean>
</table>
text tag
This tag will retrieve an internationalized string and print it out. Essentially, it calls ActionSupport's getText() method. Note: The resource bundles are searched, starting with the one associated with ActionSupport, and testing all its superclasses' bundles. It will stop once a bundle is found that contains the given text. This gives a cascading style that allow global texts to be defined for an application base class.
Attributes
| attribute | requied |
| name | T |
| value0 | F |
| value1 | F |
| value2 | F |
| value3 | F |
In this example, the internationalized text for cd.albumLabel will be retrieved from a resource bundle.
<webwork:text name="'cd.albumLabel'"/><br />
url tag
Url builds an encoded URL. If you do not include a value, then the tag will point to the current page.
Attributes
| attribute | requied |
| value | F |
| includeContext | F |
| encode | F |
| includeParams | F |
In this example, the form action value will be an url hiturl.action that is encoded.
<form action="<webwork:url value="'hiturl.action'"/>" method="POST">
...
</form>
In this example, we are adding name/value pairs to the URL. The URL tag will build up the URL appropriately. You can also place them in the normal way with "?"; i.e., - 'hiturl.action?user=john'.
<form action="<webwork:url value="'hiturl.action'">
<webwork:param name="'user'" value="'john'"/>
</webwork:url>" method="POST">
...
</form>
UI Custom Tags
A set of UI tags developed for HTML forms. These tags wrap generic HTML controls and allow them to interact with WW. If you are using ActionSupport which most implementations will, then the UI tags have built-in validation support. You can addError("form control's name", "message") within your doExecute() method and return ERROR. WW will take care of the rest. See Validation for more details.
checkbox tag
A HTML INPUT control of type checkbox.
Attributes
| attribute | requied |
| disabled | F |
| fieldvalue | T |
| id | F |
| label | T |
| labelposition | F |
| name | T |
| onchange | F |
| tabindex | F |
| theme | F |
| value | F |
In this example, a HTML INPUT control of type checkbox is displayed. Its initial value is true and the setter that will be called on an Action when the form is submitted is setAdditionalInfo(boolean additionalInfo).
<ui:checkbox label="'Check here to receive additional information. ...'" name="'additionalInfo'" fieldValue="'true'"/>
component tag
Component tag allows you to incorporate custom UI templates for rendering.
Attributes
| attribute | requied |
| id | F |
| label | F |
| labelposition | F |
| name | F |
| template | T |
| theme | F |
| value | F |
In this example, selectgroupmap.jsp is the specified template. We specify the parameters this template will need within component tag's body. The template will see these parameters and properly render its control.
<webwork:action name="'CountryMap'" id="countrymap"/> <ui:component label="'Country'" name="'country'" template="selectgroupmap.jsp"> <webwork:param name="'list'" value="@countrymap/countries"/> <webwork:param name="'groupKey'" value="'key'"/> <webwork:param name="'groupList'" value="'value'"/> <webwork:param name="'listKey'" value="'key'"/> <webwork:param name="'listValue'" value="'value'"/> </ui:component>
combobox tag
The combo box is basically a HTML INPUT of type text and HTML SELECT grouped together to give you a combo box functionality. You can place text in the INPUT control by using the SELECT control or type it in directly in the text field.
Attributes
| attribute | requied |
| disabled | F |
| id | F |
| label | T |
| labelposition | F |
| list | T |
| maxlength | F |
| name | T |
| onchange | F |
| onkeyup | F |
| size | F |
| tabindex | F |
| theme | F |
| value | F |
In this example, the SELECT will be populated from id=year attribute. Counter is itself an Iterator. It will span from first to last.
<webwork:bean name="'webwork.util.Counter'" id="year">
<webwork:param name="'first'" value="text('firstBirthYear')"/>
<webwork:param name="'last'" value="2000"/>
<ui:combobox label="'Birth year'" size="6" maxlength="4" name="'birthYear'" list="@year"/>
</webwork:bean>
label tag
A HTML LABEL that will allow you to output label:name combination that has the same format treatment as the rest of your UI controls.
Attributes
| attribute | requied |
| label | T |
| labelposition | F |
| name | T |
| theme | F |
In this example, a label is rendered. The label is retrieved from a ResourceBundle by calling ActionSupport's getText() method giving you an output of User name: a label.
<ui:label label="text('user_name')" name="'a label'"/>
password tag
A HTML INPUT control of type password.
Attributes
| attribute | requied |
| disabled | F |
| id | F |
| label | T |
| labelposition | F |
| maxlength | F |
| name | T |
| onchange | F |
| onkeyup | F |
| readonly | F |
| tabindex | F |
| theme | F |
| value | F |
In this example, a password control is displayed. For the label, we are calling ActionSupport's getText() to retrieve password label from a resource bundle.
<ui:password label="text('password')" name="'password'" size="10" maxlength="15"/>
radio tag
A HTML INPUT control of type radio.
Attributes
| attribute | requied |
| disabled | F |
| label | T |
| labelposition | F |
| list | T |
| listKey | F |
| listValue | F |
| name | T |
| onchange | F |
| tabindex | F |
| theme | F |
| value | F |
In this example, a radio control is displayed with a list of genders. The gender list is built from attribute id=genders. WW calls getGenders() which will return a Map. For examples using listKey and listValue attributes, see the section select tag.
<webwork:action name="'GenderMap'" id="genders"/> <ui:radio label="'Gender'" name="'male'" list="@genders/genders"/>
select tag
A HTML SELECT control.
Attributes
| attribute | requied |
| disabled | F |
| id | F |
| label | T |
| labelposition | F |
| list | T |
| listKey | F |
| listValue | F |
| name | T |
| onchange | F |
| tabindex | F |
| theme | F |
| value | F |
| multiple | F |
In this example, a select control is displayed built from id=agelist calling getAges() which returns a List.
<webwork:action name="'AgeList'" id="agelist"/> <ui:select label="'Age'" name="'age'" list="@agelist/ages"/>
In this example, a select control is displayed built from id=booklist calling getBooks() which returns a List. listKey is used as the value that will be returned when the form is submitted. listValue is the value displayed to the user.
<webwork:action name="'BookList'" id="booklist"/>
<ui:select label="'Book'" name="'auth'" list="@booklist/books"
listKey="'author'" listValue="'title'"/>
tabbedpane tag
Tabbed pane allows you to associated tabs with different views. When the user clicks the tab, that view will render and become current. Tabbed pane is basically a table which includes the selected tab's page in its bottom row.
Attributes
| attribute | requied |
| id | F |
| contentName | T |
| tabAlign | F |
| theme | F |
In this example, a tabbed pane is rendered with tabs aligned right. See WW's example for a more complete picture.
<p><webwork:tabbedpane id="tp1" contentName="'tabs1'" tabAlign="'RIGHT'"/></p>
table tag
Table tag renders a table. TODO
Attributes
| attribute | requied |
| modelName | T |
| sortable | F |
| theme | F |
| sortColumn | F |
| sortOrder | F |
In this example, TODO
<webwork:table modelName="'/result'" sortable="true" sortColumn="0" sortOrder="ASC"> <webwork:param name="'columnHidden(1)'" value="true"/> <webwork:param name="'columnDisplayName(2)'" value="'New Display Name'"/> <webwork:param name="'columnRenderer(0)'" value="@dateRenderer"/> <webwork:param name="'columnRenderer(2)'" value="@linkRenderer"/> <webwork:param name="'columnRenderer(4)'" value="@intRenderer"/> </webwork:table>
textarea tag
A HTML TEXTAREA control.
Attributes
| attribute | requied |
| cols | F |
| disabled | F |
| id | F |
| label | T |
| labelposition | F |
| name | T |
| onchange | F |
| onkeyup | F |
| readonly | F |
| rows | T |
| tabindex | F |
| theme | F |
| value | F |
In this example, a textarea control is rendered.
<ui:textarea label="'Comments'" name="'comments'" cols="30" rows="8"/>
textfield tag
A HTML INPUT control of type text.
Attributes
| attribute | requied |
| disabled | F |
| id | F |
| label | T |
| labelposition | F |
| maxlength | F |
| name | T |
| onchange | F |
| onkeyup | F |
| readonly | F |
| tabindex | F |
| theme | F |
| value | F |
In this example, a text control is rendered. The label is retrieved from a ResourceBundle by calling ActionSupport's getText() method.
<
<ui:textfield label="text('user_name')" name="'user'"/>
Voice XML Custom Tags
WW VoiceXML tags provide the ability for developers to build dynamic voice user interfaces (VUI). VoiceXML is a W3C specification for building speech-based applications.
WW VoiceXML tags also can be used to generate VoiceXML for a given Voice Browser based on the browser's User-Agent HTTP header value. This allows developers to build the appropriate VoiceXML template that creates the appropriate tags and attributes based on a specific vendor and/or version of a Voice Browser. See the file named vxml.properties in /WEB-INF/classes/vxml.properties for more information on customizing WW to work with different browsers.
WW VoiceXML tags have been developed and tested with the VoiceXML 2.0 specification using the Vocalocity Voice Platform, VocalOS.
audio tag
A VoiceXML VUI control of type audio.
Attributes
| attribute | requied |
| theme | F |
| templateheader | F |
| templatefooter | F |
| src | F |
| expr | F |
| tts | F |
| persona | F |
| fetchhint | F |
| fetchtimeout | F |
| maxage | F |
| maxstale | F |
In this example, a VoiceXML control of type audio is generated.
<?xml version="1.0"?>
<vxml version="2.0">
<form>
<vui:field name="'foo'">
<vui:prompt>
<vui:audio persona="'female'" src="'test.wav'" tts="'This is a test'"/>
</vui:prompt>
</vui:field>
</form>
</vxml>
field tag
A VoiceXML VUI control of type field.
Attributes
| attribute | requied |
| theme | F |
| templateheader | F |
| templatefooter | F |
| name | T |
| modal | T |
| slot | F |
| cond | F |
| type | F |
In this example, a VoiceXML control of type audio is generated.
<?xml version="1.0"?>
<vxml version="2.0">
<form>
<vui:field name="'foo'">
<vui:prompt>
<vui:audio persona="'female'" src="'test.wav'" tts="'This is a test'"/>
</vui:prompt>
</vui:field>
</form>
</vxml>
filled tag
A VoiceXML VUI control of type filled.
Attributes
| attribute | requied |
| theme | F |
| templateheader | F |
| templatefooter | F |
| action | F |
| actionaudio | F |
| mode | F |
| namelist | F |
In this example, a VoiceXML control of type filled is generated.
<?xml version="1.0"?>
<vxml version="2.0">
<form>
<vui:field name="'foo'">
<prompt>Hello, World</prompt>
<vui:filled action="'nextform.action'"/>
</vui:field>
</form>
</vxml>
grammar tag
A VoiceXML VUI control of type grammar.
Attributes
| attribute | requied |
| theme | F |
| templateheader | F |
| templatefooter | F |
| name | T |
| modal | F |
| lang | F |
| weight | F |
| mode | F |
In this example, a VoiceXML control of type grammar is generated.
<?xml version="1.0"?>
<vxml version="2.0">
<form>
<vui:field name="'foo'">
<vui:grammar mode="voice" model="@grammar"/>
</vui:field>
</form>
</vxml>
log tag
A VoiceXML VUI control of type log.
Attributes
| attribute | requied |
| theme | F |
| templateheader | F |
| templatefooter | F |
| label | F |
| expr | F |
In this example, a VoiceXML control of type log is generated.
<?xml version="1.0"?>
<vxml version="2.0">
<form>
<vui:field name="'foo'">
<vui:log>Entering Field foo</vui:log>
</vui:field>
</form>
</vxml>
prompt tag
A VoiceXML VUI control of type prompt.
Attributes
| attribute | requied |
| theme | F |
| templateheader | F |
| templatefooter | F |
| bargein | F |
| timeout | F |
| cond | F |
| count | F |
| lang | F |
In this example, a VoiceXML control of type prompt is generated.
<?xml version="1.0"?>
<vxml version="2.0">
<form>
<vui:field name="'foo'">
<vui:prompt bargein="'false'">
<vui:audio src="'welcome.wav'"/>
</vui:prompt>
</vui:field>
</form>
</vxml>
