Expand my Community achievements bar.

SOLVED

AEM 6.5 Forms XDP as HTML5 submit action "/content/xfaforms/profiles/default.submit.html" ==> error 404

Avatar

Level 4

We have Author and publish instances of AEM 6.5.4, but did not install AEM JEE. 

 

We have previous in ES4 designed XDP forms with submit buttons that post either the PDF or XDP data to various services. 

 

In AEM, we generated the HTML5 version of the XDP and the submit will only call the servlet "/content/xfaforms/profiles/default.submit.html"

 

1. We tried to configure /content/xfaforms/profiles/... with our own profile and render the HTML5 file. We configure the submitURL, we select own submit button, all to no effect. It keeps invoking "/content/xfaforms/profiles/default.submit.html" which results in a 404. 

 

2. We created a new folder in "aem/forms.html/content/dam/formsanddocuments/" and uploaded the XDP as an asset to the folder. We then use the properties of the XDP in the advance tab configure the "HTML Render Profile" to point to our profile to use the pre-fill data in this profile. (Some static configuration data). This is working fine. In the same advance tab we configure the submit URL and again the system post to "/content/xfaforms/profiles/default.submit.html" which always provide us an error 404. (We check the chrome debug window and one the parameters it does send over to the server is a parameter "submitURL" with the actual URL we configure)

 

Questions:

1. How should be configure the HTML5 submit action such that is will be invoking the correct URL?

2. Alternative, do we need to develop our own "/content/xfaforms/profiles/default.submit.html" servlet/jsp page to handle the incoming data?

 

Is there any guide on this?

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

@Eric_Stricker 

 

1. How should be configure the HTML5 submit action such that is will be invoking the correct URL?

 

2. Alternative, do we need to develop our own "/content/xfaforms/profiles/default.submit.html" servlet/jsp page to handle the incoming data?

 

To suggest, I first need to understand what your submit action does?

View solution in original post

14 Replies

Avatar

Correct answer by
Employee Advisor

@Eric_Stricker 

 

1. How should be configure the HTML5 submit action such that is will be invoking the correct URL?

 

2. Alternative, do we need to develop our own "/content/xfaforms/profiles/default.submit.html" servlet/jsp page to handle the incoming data?

 

To suggest, I first need to understand what your submit action does?

Avatar

Level 4

@Mayank_Gandhi, thanks for the reply. The data we capture will be used in two ways.

 

1 We take the XDP and store the data into a database for further processing.

2. We take the data from the XDP re-merge is with the PDF template, generate a flat PDF and send this back the to customer email as a DOR. 

 

Hope this explains. 

 

 

Avatar

Employee Advisor
@Eric_Stricker Thanks for sharing the detail. So does submit action invoke JEE workflow, any webservice or some custom JDBC call?

Avatar

Level 4

We have not installed AEM JEE as we try to avoid another server for this. We are now looking in how adobe's out-of-the-box solution should work as we have no idea.

 

We will build on Adobe's solution in this case. Be it a custom servlet, component or any other option.

Avatar

Employee Advisor
@Eric_Stricker Based on my experience if its a Web service or JEE workflow the invocation on submit should work. Lets now remove XDP from picture, why not use Adaptive form bound to a template and submit it to a servlet that invokes DOR API.

Avatar

Level 4

Adaptive template still require a XDP as a DOR. to give the form structure and context. So we still need to develop XDP's

 

In this case the client already has interactive PDF documents that can be saved as XDP so we can deploy these quite quickly with only a submit button. Then we have time to convert each XDP to an adaptive form as this does require effort to convert the forms. 

 

 

Avatar

Employee Advisor
@Eric_Stricker You can select auto-generate DOR in AF properties. You can use FDM to persist data in DB at any point in time.

Avatar

Level 4
So Coming back to my original question. There is no out-of-the box solution for the default submit action of a HTML template without AEM JEE installed?

Avatar

Employee Advisor
I would prefer submitting AF to AEM workflow or custom submit to achieve the use case. You can do same thing from XDP but since JEE isn't there you will have implement things on Osgi on your own. I will wait for @GirishBedekar to add more here.

Avatar

Level 9

Hi

To store submitted data into DB you will have to do the following

Create a Servlet in AEM

This servlet will store the submitted data in the database

Configure the HTML5 forms submit action to call this servlet on form submission

The following links should help you

Custom submit handler to invoke HTML5 form submission

Sample code to store submitted data in data. The first 3 chapters in this multi-part tutorial should help you

Let me know if you need further clarifications. Will be more than happy to help you get going

 

Avatar

Level 9

You can generate PDF with the data that was submitted from HTML5 form. 

To generate PDF you will have to write servlet and in that servlet you can merge the data with the xdp template and stream the pdf back to the user. You can also store the submitted data in the database in the same servlet

This article will help you in creating your own submit handler

https://docs.adobe.com/content/help/en/experience-manager-learn/forms/html5-forms/handle-mobile-form...

 

To trigger a workflow on html5 form submission, please follow this article

https://docs.adobe.com/content/help/en/experience-manager-learn/forms/offline-mobile-form-submission...

 

Do let us know if you need any further help/clarifications. will be happy to assist you

 

 

Avatar

Level 4

@GirishBedekar 

Thank you for the reply. Not sure if this is still valid in AEM 6.5 as we do not have  AEM JEE running and the servlet is not working without this. In the end we did found that we could manual configure the "submitServiceProxy" value for the xfaforms\profiles. This will will then override the default servlet

 

The submitted data can then be transformed by our own servlet using LCFormsService to convert the JSON formDom to XML. Then we can invoke the submitURL and to do the task specific for that form.

As reference https://docs.adobe.com/content/help/en/experience-manager-65/forms/html5-forms/service-proxy.html