First of all, JavaScript is not Java. It has nothing to do with Java (The language and its associated technologies from Sun Microsystems). To be honest, I'm not even sure why it's called JavaScript.
I seem to be having trouble assigning a jsp variable to a js variable. For reference, <script></script> is javascript, and <%%> is java. I've shortened the following code to cover the relevant ...