I have inherited legacy code that invokes a Javascript in external file for a link action. Below is a snippet of the JS function
function webaction(){
$.ajax({
url:contextpath + '/docheck.html'
// more logic below
As can be seen, since is not used, it is failing HDIV validation. How should I create the URL inside the JS for HDIV compliance? Is it possible to define JSTL tag inside the JS function so that I can use
<c:url>
inside the JS?
You have an explanation with examples of the integration of HDIV with AJAX on this webpage.
Summarising, you have to create all link and form elements on the server side, if they are created on the client side HDIV does not have any way to process them.
Here it is an example with pure JS:
I hope it helps
Fernando Lozano (HDIV Team)