I'm using jQuery jTable to list some data related to a class in my model. I send the request to the corresponding method responsable for fetching the data, and when I return the necessary JSON object I get an internal server error (500).
I don't get any exception or error code in my console, everything run as usual, except that I get this error and nothing else.
Here is the relevant part of the JSP:
$('#records').jtable({
messages : myMessages,
title: 'Records',
paging: true,
pageSize: 20,
sorting: true,
defaultSorting: 'date DESC',
actions: {
listAction: '/filter'
},
fields: {
id: {
title: 'Id',
list: true,
display:function(data){
return data.record.id;
}
},
date: {
title: 'Date',
list: true,
display:function(data){
return data.record.date;
}
},
userName: {
title: 'User',
list: true,
display:function(data){
return data.record.user.name;
}
},
dealerName: {
title: 'Dealer',
list: true,
display:function(data){
return data.record.dealer.name;
}
},
vendorName: {
title: 'Vendor',
list: true,
display:function(data){
return data.record.vendor.name;
}
},
totalValue: {
title: 'Total Value',
list: true,
display:function(data){
return data.record.totalValue;
}
},
recordStatus: {
title: 'Record Status',
list: true,
display:function(data){
return data.record.recordStatus;
}
},
paymentStatus: {
title: 'Payment Status',
list: true,
display:function(data){
return data.record.paymentStatus;
}
}
}
});
$('#records').jtable('load');
And here is the Spring MVC signature mapping the request:
@RequestMapping(value = "/filter", method = RequestMethod.POST)
public @ResponseBody JsonJTableResponse filter(int jtStartIndex,
int jtPageSize, String jtSorting, HttpServletRequest request) {
long st = Long.valueOf(jtStartIndex);
long sz = Long.valueOf(jtPageSize);
List<RecordTO> records = (List<RecordTO>) mgrRecord.getList();
JsonJTableResponse jtable = new JsonJTableResponse();
jtable.setResult("OK");
jtable.setTotalRecordCount(String.valueOf(mgrRecord.getListCount()));
jtable.setRecords(records);
return jtable;
}
The filter method is getting executed. The properties I set in jtable are being set. The only thing that maybe may cause some problem (even though I can't see why) is that the records list has RecordTO objects that don't have all their properties set, just the relevants for the jTable listing.
For example, the following properties are set:
(Long) id(Date) date(UserTO) user.name(DealerTO) dealer.name(UserTO) vendor.name(Double) totalValue(String) recordStatus(String) paymentStatus
I have already looked in every corner for a solution but can't figure it out. What could be the problem?
If you want more information that you may find it's relevant, just ask me.
Thanks.