/**
* Performs on-the-fly validation of the form field 'name'.
* @param value This parameter receives the value that the user has typed.
* @return Indicates the outcome of the validation. This is sent to the browser.
*/
public FormValidation doCheckName(@QueryParameter String value) throws IOException, ServletException {
if (value.length() == 0) {
return FormValidation.error("Please set a name");
}
if (value.length() < 4) {
return FormValidation.warning("Isn't the name too short?");
}
return FormValidation.ok();
}

Example 39

From project asadmin, under directory /war-example/src/main/java/org/n0pe/mojo/examples/war/.