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.
我使用Adobe LiveCycle ES4 + SP1开发了一个简单的HTML5表单,它将提交给Java JSP。此外,我开发了简单的JSP来从请求InputStream中检索提交的XML。
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
下载XDP文件:点击这里下载JSP文件:点击这里
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:
以下代码行用于将HTML5提交到JSP,这些代码位于“保存”按钮的单击事件下:
var theBtnSubmit = cmdSubmitForm.resolveNode("#event").submit;
var theTarget = form_config.server_url.rawValue + "?" + "action=save" + "&form_id=" + form_config.form_id.rawValue + "§ion_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:
以下代码行用于获取InputStream并转换为字符串:
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.
问题:在服务器上,我无法检索XML格式的表单字段和值。我得到的是填写在表单中的字段的连接值。
Appreciate your help to solve this problem.
感谢您的帮助以解决此问题。
1 个解决方案
#1
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:
实际上,上面的方法很好,唯一的问题是我必须使用以下代码行来转义XML输出:
<%@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/>");
#1
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:
实际上,上面的方法很好,唯一的问题是我必须使用以下代码行来转义XML输出:
<%@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/>");