0

I developed a simple HTML5 form using Adobe LiveCycle ES4 + SP1 which will submit to Java JSP. Also, I developed simple JSP to retrieve the submitted XML from request InputStream.

What I am getting on the server is the concatenated values of the form fields. See snapshots below for more details.

Download XDP file: click here
Download JSP file: click here

The following lines of code are used to submit the HTML5 to the JSP which are placed under the click event of the "Save" button:

var theBtnSubmit = cmdSubmitForm.resolveNode("#event").submit;
var theTarget = form_config.server_url.rawValue + "?" + "action=save" + "&form_id=" + form_config.form_id.rawValue + "&section_id=" + form_config.section_id.rawValue;
theBtnSubmit.target = theTarget;
cmdSubmitForm.execEvent("click");

The following lines of code are used to get the InputStream and convert to string:

ServletInputStream ris = request.getInputStream();  
String theString = IOUtils.toString(ris); 

The problem:
On the server, I am unable to retrieve the form fields and values in XML format. What I am getting is the concatenated values of the fields which are filled in the form.

Appreciate your help to solve this problem.

HTML5 Form in design mode The hidden submit button cmdSubmitForm

enter image description here

enter image description here

enter image description here

tarekahf
  • 738
  • 1
  • 16
  • 42

1 Answers1

0

Actually, the above method is fine, the only thing is that I had to escape the XML output using the following lines of code:

<%@page import="org.apache.commons.lang3.StringEscapeUtils" %>
...
String theString = IOUtils.toString(ris, Charset.forName("UTF-8"));
theString = StringEscapeUtils.escapeXml10(theString);
out.print("input stream in string format : " + theString + "<br/>");
tarekahf
  • 738
  • 1
  • 16
  • 42