Use the Submit to REST Endpoint action to post the submitted data to a rest URL. The URL can be of an internal (the server on which the form is rendered) or an external server.
Typically customer would want to submit the form data to an external server for further processing.
To post data to an internal server, provide a path of the resource. The data is posted the path of the resource. For example, /content/
To post data to an external server, provide a URL. The format of the URL is http://host:port/path_to_rest_end_point. Ensure that you configure the path to handle the POST request anonymously.
For the purpose of this article, I have written a simple war file that can be deployed on your tomcat instance. Assuming your tomcat is running on port 8080, the POST url is going to be
when you configure your Adaptive Form to submit to this endpoint, the form data and the attachments if any can be extracted in the servlet by the following code
String formData = request.getParameter("dataXml"); // Form attachments are sent as parts called "attachments". The code below saves an attachments which is of type images/jpg to the file system request.getPart("attachments").write("c:\\attachments\\formattachment.jpg");
To test this on your server please do the following
- Install Tomcat if you do not have it already. Instructions to install tomcat are available here
- Download the zip file associated with this article. Unzip the file to get the war file.
- Deploy the war file in your tomcat server.
- Create a simple Adaptive Form and configure its submit action as shown in the screenshot above. The POST URL is HTTP://localhost:8080/AemFormsEnablement/HandleFormSubmission. If your AEM and tomcat are not running on localhost, please change the URL accordingly.
- To enable multipart form data submission to tomcat, please add the following attribute to the context element of the <tomcatInstallDir>\conf\context.xml and restart your Tomcat server.
- <Context allowCasualMultipartParsing="true">
- Preview your Adaptive Form and submit. Check the tomcat console window for messages.