After a profile form operation—registration, login, or logout—is complete, you might want to redirect the user to a new page. As in standard HTML, you can use the action attribute of the form tag to specify a page to display on form submission.

The action attribute can specify only a single page. 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.

The ProfileFormHandler 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 operation except cancel has corresponding success and failure URL properties:

ProfileFormHandler operation

Success/failure URL properties

changePassword

changePasswordSuccessURL
changePasswordErrorURL

create

createSuccessURL
createErrorURL

delete

deleteSuccessURL
deleteErrorURL

login

loginSuccessURL
loginErrorURL

logout

logoutSuccessURL
logoutErrorURL

update

updateSuccessURL
updateErrorURL

Note: The cancel operation has only one navigation property, cancelURL.

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 loginErrorURL, redirecting the user to login_failed.jsp. If the lookup operation succeeds, and the value of loginSuccessURL is not set, the user is redirected to the action-specified page index.jsp:

<dsp:form action="index.jsp" method="post">
<dsp:input
  bean="ProfileFormHandler.loginErrorURL" type="hidden" value="login_failed.jsp"/>
...
</dsp:form>