pass var to a jsp code example
Example 1: how to pass java variable to javascript function in jsp
<% String str="Hello World"; %>
<html>
<head>
<script language="javascript">
function access(){
var s="<%=str%>";
alert(s);
}
</script>
</head>
<body onload="access()">
</body>
</html>
Example 2: how to pass a variable to jspf
<c:set var="foo" value="bar"/>