B.25 InputTask

The InputTask can be used to interactively set property values based on input from the console (or other Reader).

Table B.25: Attributes

propertyNameStringThe name of the property to set.n/aNo
defaultValueStringThe default value to be set if no new value is provided.n/aYes
messageStringPrompt text (same as CDATA).n/aYes
promptCharStringThe prompt character to follow prompt text.n/aNo
validArgsStringComma-separated list of valid choices the user must supply. If used, one of these options must be chosen.n/aNo
hiddenBooleanWhether to hide user input.n/aNo

B.25.1 Examples

<!-- Getting string input -->
<echo>HTML pages installing to: ${documentRoot}</echo>
<echo>PHP classes installing to: ${servletDirectory}</echo>

<input propertyname="documentRoot">Web application document root</input>
<input propertyname="servletDirectory"
  defaultValue="/usr/servlets" promptChar="?">PHP classes install dir</input>

<echo>HTML pages installed to ${documentRoot}</echo>
<echo>PHP classes installed to ${servletDirectory}</echo>

<!-- Having the user choose from a set of valid choices -->
<echo>Choose a valid option:</echo>

<input propertyname="optionsChoice" validargs="foo,bar,bob">
  Which item would you like to use