Toggle menu

Redirect: GET|POST /http/redirect

Parameters

NameTypeDescription
sessionIdUUID (str enc.), requiredThe formSessionId
nonceUUID (str enc.), requiredThe nonce
redirectTypeString (enum), requiredDefault: "HTTP303". Other possible value: "SSF" (self-submitting form).

The type of redirect to perform. Typically an HTTP 303 response is returned, but in some cases a self-submitting form must be used to perform the redirect
processSubmissionBoolean, requiredDefault: true

If false, the skeleton processor will not be invoked but the redirect response will be returned. Used for the RealEx payment field type to not perform processing on the initial call that returns the self-submitting form (via redirectType), but to perform it on the second call into redirect resulting from the self-submitting form post (with a redirectType of HTTP 303)

The redirect HTTP method functions as the redirect target for form actions that require the user to be redirected to an external service before returning and resuming form processing (eg the payment field types).

Form processing for the page containing the field type for the external service must be suspended until coming back from the external service in order for the Forms Service and field types to be aware of any results from such a redirection. For example information on whether or not a PayPal payment was successful must be available to the control skeleton scripts to decide whether to advance to the "payment complete" page, or the "payment failure" page.

Example

  1. Render form page that contains the external service field type
  2. Upon submission of the page the external service field type's ExecutePreRedirectActionSkel is executed which:
    1. Does what is required before redirecting the user to the external service, such as creating some form of transaction
    2. Specifies the /http/redirect endpoint as the URL to return to after coming back from the external service, containing the sessionId and nonce as query parameters
    3. Generates a REDIRECT action with the URL property set to the appropriate external service URL supplying any identifiers generated when the transaction was created (control processing is not yet performed as part of the form submission as we do not yet have the results of the external transaction which may influence them.When a REDIRECT action is processed control processing is postponed until the external service redirects back to the /http/redirect endpoint)
    4. The user is redirected to the external service
  3. After interaction with the external service is complete, the service redirects the user to the previously specified return URL - the /http/redirect endpoint.
  4. The /http/redirect endpoint:
    1. Initialises the Skeleton Processor, setting the variables described below, which can be read by all skeletons
    2. Updates form data
    3. Performs control processing

Skeleton Processor Variables on Redirect

NameTypeDescription
Props["REDIRECT"]Booleantrue allows easy if ( Props["REDIRECT"] ) { ... } checks
Props["REDIRECTQUERYPARAMS"]Map<String,String>Param Name: Value
Props["REDIRECTHEADERS"]Map<String,String>Header Name: Value
Props["REDIRECTFIELDS"]Map<String,List<String>>Field Name: Array of values
Non-null if invoked as a multipart request
Props["REDIRECTBODY"]StringPost request body as a string if non-multipart, null otherwise
Last modified on June 27, 2023

Share this page

Facebook icon Twitter icon email icon

Print

print icon