B.31 InputTask

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

Table B.33: Attributes

NameTypeDescriptionDefaultRequired
propertyName String The name of the property to set.n/aNo
defaultValue String The default value to be set if no new value is provided.n/aYes
message String Prompt text (same as CDATA).n/aYes
promptChar String The prompt character to follow prompt text.n/aNo
validArgs String Comma-separated list of valid choices the user must supply. If used, one of these options must be chosen. n/aNo
hidden Boolean Whether to hide user input.n/aNo

B.31.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
</input>