title: passing Struts 2 property to javascript
body: <p>I write the following code in simulate.jsp , to receive some String "simulationInfos" from the Server:</p>
  
  <pre><code>&lt;s:property id="simulationInfos" value="simulationInfos" /&gt;&lt;br/&gt;
  </code></pre>
  
  <p>When simulate.jsp has been returned, I can see, that the String simulationInfos existing.</p>
  
  <p>My Question is: How can I pass simulationsInfos to java script?</p>
  
  <p>I tried the following: </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var data=document.getElementById("simulationInfos").value;
  console.log("data is: ", data);
  
  And with jQuery:
  var data=$("#simulationInfos").val();
  &lt;/script&gt;
  </code></pre>
  
  <p>and I get the following Error in Firebug: Uncaught TypeError: Cannot read property 'value' of null</p>
  
  <p>How can I pass some struts 2 variable to javascript?</p>