Most pages in the checkout process have their errorURL set to their own address. For example, if an error is encountered during processing because a user enters an expired credit card, the user is returned to that same page. All of the error messages print on that page and the user can correct the mistake on that page. Displaying error messages to a user follows a standard pattern:

<!-- Check to see if there are any errors on the form -->
<dsp:droplet name="/atg/dynamo/droplet/Switch">
<dsp:param bean="ShoppingCartModifier.formError" name="value"/>
<dsp:oparam name="true">
  <font color=cc0000><STRONG><UL>
    <dsp:droplet name="/atg/dynamo/droplet/ErrorMessageForEach">
      <dsp:param bean="ShoppingCartModifier.formExceptions" name="exceptions"/>
      <dsp:oparam name="output">
     <LI> <dsp:valueof param="message"/>
      </dsp:oparam>
    </dsp:droplet>
    </UL></STRONG></font>
</dsp:oparam>
</dsp:droplet>

The ShoppingCartModifier stores all error messages that it encounters in the formExceptions array property. If there are errors, the code iterates through the array to display the relevant messages.

 
loading table of contents...