After a form operation—lookup, update, delete, or insert—is complete, the action attribute of the dsp:form tag specifies the page to display. You might want to specify several different pages, where the user’s destination depends on the nature of the form operation and whether or not it succeeds.

A SimpleSQLFormHandler has a set of properties you can use to control navigation after a form operation. These properties specify the URLs where the user is redirected on certain error and success conditions. Each submit handler method except handleReset has corresponding success and failure URL properties:

Handler method

Success/failure URL properties

handleLookup

lookupSuccessURL
lookupErrorURL

handleUpdate

updateSuccessURL
updateErrorURL

handleInsert

insertSuccessURL
insertErrorURL

handleDelete

deleteSuccessURL
deleteErrorURL

The dbErrorURL property specifies the URL to use if a database error occurs when submitting the form.

The value of each property is a URL relative to the page specified by the form’s action attribute or a local URL defined absolutely from the root. The default value of each property is null, so you must set these properties explicitly. You can specify the values of these URL properties in the form handler component, or with hidden input tags in the JSP. If these property values are not set, the action-specified page is displayed on form submission.

The following example sets the value of lookupErrorURL, redirecting the user to lookupError.jsp. If the lookup operation succeeds, and the value of lookupSuccessURL is not set, the user is redirected to the action-specified page index.jsp:

<dsp:form action="index.jsp" method="post">
<dsp:input
   bean="MyFormHandler.lookupErrorURL" type="hidden" value="lookupError.jsp"/>
...
</dsp:form>

Copyright © 1997, 2017 Oracle and/or its affiliates. All rights reserved. Legal Notices