I found a code snippet that looks like this
createReportProfile = function () {
var url = "<%= createLink(controller: 'configCashFlowReport', action: 'saveCreate')%>";
var data = $("form[id=addReportConfigForm]").serializeArray();
var doneFunction = function (data) {
$("#returnAddReportProfiletDiv").html(data);
}
ajaxGet(url, data, doneFunction, undefined);
return false; }
Please take note of this line
var url = "<%= createLink(controller: 'configCashFlowReport', action: 'saveCreate')%>";
CreateReportProfile function is inside script tags and is saved in report.gsp. Obviously, the code is written using javascript but there is a grails code inside it (createLink).
1) How was grails able to detect that it should evaluate the createLInk tag? Because of <%= %>
?? But it is inside a double quote. How does grails differentiate a simple string and a string that should be evaluated?
2) How is .gsp file parsed?