title: Can I put jsp specific code in an external script file
body: <p>I would like to get values sent by the <code>Servlet</code> using the <code>HttpSession</code> in an external js file using requirejs' <code>define</code> function:</p>
  
  <pre><code>define(function(){
      return {
          /*Get values from the java session*/
          gisuniqkey:&lt;%=session.getAttribute('gisuniqkey')%&gt;,
          scenario:&lt;%=session.getAttribute('scenario')%&gt;,
          operation:&lt;%=session.getAttribute('operation')%&gt;,
          objkey:&lt;%=session.getAttribute('objkey')%&gt;
      }
  });
  </code></pre>
  
  <p>Is it possible to do this? Any dependencies that I should include when doing this?
  Eclipse tells me that there is an error when doing this.</p>
  
  <p>The error message simply calls it a syntax error:</p>
  
  <pre><code> Uncaught SyntaxError: Unexpected token &lt; java_to_script.js:3
   Uncaught TypeError: Cannot read property 'gisuniqkey' of undefined     
   gmaps_createScenario.js:15
  </code></pre>
  
  <p>All I care is that I do not use a global variable inside my jsp...and that it should work well with require.js,it would be splendid if it could be made a reusable module.</p>