title: How to retrieve setAttribute from servlet into JavaScript
body: <p>I'm trying to retrieve the value of my setAttribute into my javascript code but I get a syntax error when I run the page.</p>
  
  <p>Here is the code of my setAttribute in my servlet: </p>
  
  <pre><code>request.setAttribute("codeIGA", codeIGA); //a string is being passed here
  </code></pre>
  
  <p>Here is the code of my JS: </p>
  
  <pre><code>$(document).ready(
      function () {
          var count = 0;
          var lastCodeIGA =  ${sessionScope.codeIGA}; // syntax error here
          console.log(lastCodeIGA);
              .
              .
              . 
              etc
  </code></pre>
  
  <p>How can I retrieve the value from my servlet and input it into my JS?</p>