How can I convert a JavaScript variable to a Java variable?
<p>I need to convert a variable from JavaScript into a Java variable. I'm asking users for their e-mail ids with a Block-UI popup through Test Box. If the field is neither null nor empty, the e-mail id should be sent to a session variable so that it can be accessed anywhere in the project.</p>

<p>Here's my code:</p>

<pre><code>function sbtEmail(){
    var email = document.getElementById("EmailId").value;
    if (email == null || email == ""){
        alert("Enter your contact Email address to continue...!");
        document.getElementById("EmailId").focus();
    } else {
        &lt;%session.setAttribute("quoteEmail",email);%&gt;
        window.location.href = "demo2.jsp";
    }
}
</code></pre>

<p>It doesn't work. What am I doing wrong?</p>
