This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I don't think there is direct way to assign the variable as java script executes at client side and jsp code(as a servlet) at server side. However u can assign the java script variable to a hidden form field and pass to server where the jsp can get it using request.getParameter().