JSP is a HTML code generator. JS is part of HTML.
You actually don't "pass" variables from JSP/JSTL to HTML/JS. You basically let JSP "print" HTML/JS code the way you want, including JS variables. You only need to make sure that you write JSP code in such way that it generates syntactically valid HTML/JS code output.
Thus, so:
onclick="test('${Key1}')"
Note the importance of singlequotes if the variable represents a character sequence, e.g. from a Java String
variable. You of course want it to end up in generated HTML output as below (you can verify via rightclick, View Source in webbrowser):
onclick="test('value of variable Key1')"
and thus not like so:
onclick="test(value of variable Key1)"
It would however work fine without singlequotes if the variable actually represents a number:
onclick="test(${Key1})"
which should then end up in HTML output like this:
onclick="test(42)"