Java/JSP/JSTL runs at the server machine and produces HTML/CSS/JS output.
Server sends HTML/CSS/JS output to client machine.
Client receives HTML/CSS/JS and only then it starts to run.

Whenever you want to invoke Javascript with Java, you need to write it out as a Javascript function or variable.
Whenever you want to invoke Java with Javascript, you need to invoke a request to the server machine.

If you really, really want to perform client-dependent tasks, then you need to do it fully in Javascript. You can't do a browser-check reliably in Java.