I have this definition of a Datatable defined on a Thymeleaf template of a SpringBoot application, using Datatables:
/*
$(document).ready(function() {
var table = $('#workerEventTable').dataTable( {
order: [[ 0, "desc" ]],
select: true,
bLengthChange: false,
stateSave: true,
pageLength: 20,
ajax: '/acerinox/api/workerevent/datatableList', /*acerinox is the app context*/
"columns": [
{ data: 'id' },
{ data: 'deviceId' },
{ data: 'companyName' },
{ data: 'description' },
{ data: 'battery' },
{ data: 'dateTime' },
{ data: 'signal' },
{ data: 'data' },
{ data: 'alarm' }
]
});
} );
/*]]>*/
I would like to know if there a way to get the app context from somewhere, but not hardcoded, even from a property file.