I am trying to integrate HDIV into our existing application. But, Am facing an issue w.r.t. CSRF tokens in the following use case.
Use Case:
I use JQuery Data tables in order to render the data in Tabular format. We have a Data table column which has hyperlinks. I need to add the CSRF token to each hyperlink which is generated based on JSON data that's used to render the JQUERY Data table.
Ideally, As per HDIV documentation, we need to embed all the URLs in c:url or spring:url tags inorder to generate the CSRF tokens on the Server. But, Jquery Data table uses JSON inorder to render the data and the hyperlinks in my Data table.
As we can not use spring:url (Executed at Server) with the dynamic JSON used for Data table generation (Executed by the browser), How can i let HDIV know that the hyperlinks generated using the JSON data should be appended with CSRF tokens?