title: Javascript - session.getAttribute returns undefined value
body: <p>I have a JSP form that reads input from the user and calls a Java servlet to process
  data. Once the data been proccesed, <code>session.setAttribute</code> is called to store important information. Then in Javascript I try to read the session variable and display
  it on the screen. The code looks like this (some code removed):</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
     var test = &lt;%= session.getAttribute( "mySessionVar" ) %&gt;;
     document.write (test);
  }
  </code></pre>
  
  <p>When the user enters an integer in the form, all is working as expected and the output
  displayed on the screen properly. However, when the user enters a String in the form, 
  <strong>"undefined"</strong> is displayed on the screen. </p>
  
  <p>Any idea what I'm doing wrong? </p>