У меня запрос POST
, подобный приведенному ниже:
<form action="get_eD_XML" method="POST">
<input type='text' name='data'value='<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:epsos="urn:epsos-org:ep:medication" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">...</ClinicalDocument>' />
<input type="submit" value="Test" />
</form>
Я пытаюсь получить значение, используя:
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
BufferedReader in = new BufferedReader(
new InputStreamReader(request.getInputStream(), "UTF-8"));
JSONObject responseJSON = new JSONObject();
String inputLine;
String data = "";
while ((inputLine = in.readLine()) != null) {
data =inputLine.replace("data=", "");
}
System.out.println(data);
}
Однако,содержимое данных выглядит примерно так:
%3CClinicalDocument+xmlns%3D%22urn%3Ahl7-org%3Av3%22+xmlns%3Aepsos%3D%22urn%3Aepsos-org%3Aep%3Amedication%22+xmlns%3Axsi%3D%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema-instance%22%3E%
Знаете, как это исправить?