title: JSP variable initialization is happening after JS runs
body: <p>I'm initializing a JSP string inside a Liferay portlet:</p>
  
  <pre><code>String json = "{}";
  
  // returns json
  json = LiferayPortlet.makeCurlCall();
  
  ...
  
  &lt;script&gt;
  
  $(window).load(function(){
  
      //initialize js variable
      jsData = "${json}"; 
  
      // initialize the page
      initializePage(jsData);
  });
  
  
  &lt;/script&gt; 
  </code></pre>
  
  <p>The issue I'm having is that <code>LiferayPortlet.makeCurlCall();</code> is returning json, but <code>jsData</code> is not being initialized to it, instead its being set to <code>""</code>. Is there a way to initialize <code>jsData</code> to the json that is being returned from the function above?</p>