title: Datatable ajax URL app. context
body: <p>I have this definition of a Datatable defined on a Thymeleaf template of a SpringBoot application, using Datatables:</p>
  
  <pre><code>&lt;script th:inline="javascript"&gt;
  /*&lt;![CDATA[*/   
  
  $(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' }
             ] 
      });
  } );
  
  /*]]&gt;*/
  &lt;/script&gt;
  </code></pre>
  
  <p>I would like to know if there a way to get the app context from somewhere, but not hardcoded, even from a property file.</p>