title: Jquery Ajax: Cannot assign to a function result error
body: <p>In my ajax servlet I am setting a list of objects to request attribute.</p>
  
  <pre><code> request.setAttribute("testModelList",testList);
  </code></pre>
  
  <p>In my script I am trying to retrieve the attribute and set in to hidden variable.</p>
  
  <pre><code>// my JS 
  $('#testDetails').val() = '${testModelList}';
  </code></pre>
  
  <p>My jsp</p>
  
  <pre><code>&lt;INPUT type="hidden" id = "testDetails" &gt;
  </code></pre>
  
  <p>But I am getting an error</p>
  
  <blockquote>
    <p>Cannot assign to a function result </p>
  </blockquote>
  
  <p>Can anyone help me how to get the request attribute list to the hidden variable in JSP through Ajax?</p>