Search code examples
orbeonxformsformbuilder

Accessing request parameters in Orbeon form via POST


I want to access some request parameters in an Orbeon form sent via post to this form. I tried to use the XPath expression xxf:get-request-parameter('task_id') within the form, but this only works when the parameter is attached to the url (e.g. orbeon/fr/Activiti/dokumentfreigabe/new?task_id=4711).

Since I do not want to send all parameters in the url (but via POST and SSL), I need a solution to access request parameters in an orbeon form sent as a POST-Parameter.


Solution

  • You can't access parameters sent to the form with a form POST with an XPath function. Could you use an HTTP header to pass this value, instead of a form POST? If it possible, then you could use xxf:get-request-header('your-header').

    If the form POST is done by the browser, and not by another server-side app or filter or reverse proxy, then you obviously wouldn't be able to set the header directly from the browser. However, you could continue doing the form POST from the browser, and add a servlet filter that extracts the value, and sets the value of a header, so you can then read it with xxf:get-request-header('your-header').