posted 11 years ago
I dont think JS variables can be assigned to JSP. JSP variables can assign to JS because, the JS in fact is generated in the server side. And thus, the server side can assign server side variable value to the JS before sending it to the client. However, the reverse is not true. At the server side, JS variable contains NO value of the client. (Becos the client does not receive the page yet) The only way to do this is, you can pass the JS variable as a request, and then send to the JSP as a request parameter, and then assign that value to the JSP variable. Hope this help. Nick.