Form handler components all support a cancel operation, which is invoked by a form’s Cancel button. The input tag for a Cancel button uses the following format:

<dsp:input type="submit" value="button-label" bean="handler-component.cancel"/>

By default, the cancel operation redirects to the page specified in the form handler’s cancelURL, property. A form handler typically provides its own implementation of this operation in handleCancel(), often using it to empty the form fields when the user clicks Cancel. For more information, see the description of handleCancel() in the ATG Platform Programming Guide.

Redirecting to another page

The form handler property cancelURL specifies the page where users are redirected after they click Cancel. You can edit this property directly; however, it is better practice for a JSP to set cancelURL through a hidden input tag attribute to a value that is appropriate to the current context. The URL that you specify in cancelURL is resolved relative to the page designated in the form’s action attribute, so setting cancelURL and action on the same page can help avoid URL errors. For example:

<dsp:input type="hidden" bean="MyFormHandler.cancelURL" value="../index.jsp"/>