Possible Duplicate:
JSP Variable Accessing in JavaScript
I have a java variable and a javascript on a jsp page.
<% int max=70; %>
How do I get the variable from the script?
var x = ???
I tried document.getElementById() but unfortunately it didn't seem to work as it isn't a html element
this is my error:
Unable to compile class for JSP:
An error occurred at line: 13 in the jsp file: /search.jsp
max cannot be resolved
10:     function validateForm() {
11:         var x=document.forms["search"]["capacity"].value;
12:         var y=document.forms["search"]["date"].value;
13:         var m=<%=max%>;
14:         if (isNaN(x)) {
15:             alert("Capacity must be an Integer");
16:             return false;
 
     
    