Wednesday, June 18, 2014

Access JSTL variable define in a jsp inside AJAX call

 Access JSTL variable define in a jsp inside AJAX call

JSP file where It is defined JSTL variable like this (form value) :
<c:set var="idEtape" value="${etapeForm.etape.idEtape}" scope="page"/>
<c:set var="idContact" value="${etapeForm.etape.idContact}" scope="page"/>
<c:set var="numeroDossierFoa" value="${etapeForm.dossier.numeroDossier}" scope="page"/>
<script type="text/javascript" src=myfile.js"/>"></script>
  EL expression to access this variable like below :
var request = $.ajax({type: "POST",
    url: "/myUrl/" + '${numeroDossier}' + "/" + '${idContact}' + "/" + '${idEtape}',
    cache: false
    });
 


No comments:

Post a Comment