If the jsp variables are of primitive type and once the page is loaded the values are not goin to change,
then you can forward the variables to the javascript.
Example.
"& lt;"html>
"& lt;"head>
"& lt;"script language="javascript">
var jspvariable;
function
test(tempVariable){
jspVariable = tempVariable;
alert(jspVariable);
}
"& lt;"/script>
"& lt;"/head>
"& lt;"body>
"& lt;"%
int jspVariable = 2;
%>
wwindow. oon load = function(){
test("& lt;"%=jspVariable%>){
}
"& lt;"/body>
"& lt;"/html>
after the page is loaded you can use the jspVariable in the jsp. it is a global variable in the Javascript scope