How to pass an EL variable to javascript

You can’t have JSTL evaluated in .js files. Only in .jsp files. (unless you remap the jsp servlet, but I wouldn’t advise to do so).

The better approach is to define the variables in the .jsp including the .js, and pass these variables as arguments to an initializing function.

Also make sure you don’t have isELIgnored="true"

Leave a Comment