Reusable Dialog Components Frequently Asked Questions (RDC FAQ)
[Step 0:Guide to effective reuse] Reuse answers
Contents
- Can I control the number of nbest results returned or the minimum confidence threshold for a RDC?
- How do I make a RDC exit gracefully after a fixed number of <noinput> or <nomatch> events?
- Where can I find the ''initial'' grammar?
- How do I change the prompts, or timeout values for an RDC instance?
- The VoiceXML browser complains about malformed documents right after transitioning between JSPs using <rdc:struts-submit>. Is this a known issue?
Can I control the number of nbest results returned or the minimum confidence threshold for a RDC?
For specifying the number of nbest results that you want to receive, use the numNBest attribute. For controlling the confidence threshold, use the minConfidence attribute. It is best to check in the deployment platform documentation to see whether the confidence range is [0.0-1.0] or [0-100].
<rdc:time id="myTime" numNBest="5" minConfidence="0.4F" />
How do I make a RDC exit gracefully after a fixed number of <noinput> or <nomatch> events?
The maxNoInput and maxNoMatch attributes provide this functionality. Using these means the author has to be aware that the RDC may return an empty value if a graceful exit path is chosen.
<rdc:date id="myDate" maxNoInput="3" maxNoMatch="3" />
Where can I find the ''initial'' grammar?
It is in the resource bundles in the org.apache.taglibs.rdc.resources package.
How do I change the prompts, or timeout values for an RDC instance?
It is clear that the prompts contained in the default configuration file for any component are almost guaranteed to be replaced in each instance while authoring an application, since the author will want to use prompts that fit the given application and the given dialog within the application.
The following RDC uses the default prompts for date:
<rdc:date id="myDate" />
But this one uses the set of prompts and timeouts defined in date-cfg.xml:
<rdc:date id="myDate" config="date-cfg.xml" />
The VoiceXML browser complains about malformed documents right after transitioning between JSPs using <rdc:struts-submit>. Is this a known issue?
The VoiceXML browser complains to the effect of The markup in the document following the root element must be well-formed. The <rdc:struts-submit> tag internally forwards the request and should be used after the last bit of template text in the JSP, to ensure that the buffer for the JSP writer is cleared appropriately.
Example of incorrect usage:
[...]
<vxml version="2.0" xml:lang="en-US" xmlns="http://www.w3.org/2001/vxml" >
[...]
<rdc:xxxx id="test" ... />
<c:if test="${not empty test}">
<rdc:struts-submit ... />
</c:if>
[...]
</vxml> <%-- Last bit of template text --%>Example of correct usage:
[...]
<vxml version="2.0" xml:lang="en-US" xmlns="http://www.w3.org/2001/vxml" >
[...]
<rdc:xxxx id="test" ... />
[...]
</vxml> <%-- Last bit of template text --%>
<c:if test="${not empty test}">
<rdc:struts-submit ... />
</c:if>For more details, take a look at Bugzilla entry 36150