I would like to get results into jquery datatables via JSON. The page is written in JSP.
The table contain a special field with XML string:
{
"sEcho": 1,
"iTotalRecords": "3800",
"iTotalDisplayRecords": "3800",
"aaData": [ [ "16.12.2013 14:14:55 GMT",
"Unknown",
"Unknown",
"",
"26414321279",
"ci1387203295280.36875276@czchols2138_te",
"<?xml version="1.0" encoding="UTF-8"?> <ExtendedEventContent> <Transport_Failure> <Error>Incomplete data received</Error> <Transport_Error>com.cyclonecommerce.tradingengine.transport.FileNotFoundException: 550 TEST.xml: The system cannot find the file specified. ; command=RETR TEST.xml</Transport_Error> </Transport_Failure> </ExtendedEventContent> ",
"" ] ,
...
datatables initiation script:
<script>
$(document).ready(function() {
$('#failedDetails').dataTable( {
"bStateSave": true,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "./inc_failed_details_json.jsp",
"aLengthMenu": [[10, 50, 100, -1], [10, 50, 100, "All"]],
"iDisplayLength": 10,
"aaSorting": [[ 0, "asc" ]]
} );
} );
I am getting of course error:
... JSON data from server could not be parsed. This is caused by a JSON formatting error.
The data are gathered from Oracle DB. I have tried to use replace for the XML value by:
(select replace(max(details), '"', '\"') from cyclone.messageevents where messageoid = m.oid) Details,
"<?xml version=\"1.0\" encoding=\"UTF-8\"?> <ExtendedEventContent> <Reason> <Event>Messaging.Message.Duplicate.Message</Event> </Reason> </ExtendedEventContent> "
but with same result.
Exists anybody who can help with that?