title: What's the best way to parallelize calls in JSP?
body: <p>My understanding of JSP is that each line in the java code is run step by step (in sequence). E.g. if I have a code below, <code>doSomething("apple")</code> will be executed first until it returns a value, then <code>doSomething("orange")</code> will be executed next until it returns a value, then finally <code>doSomething("pear")</code> will be executed until it returns a value and the whole page is displayed.</p>
  
  <pre class="lang-jsp prettyprint-override"><code>&lt;table border="1"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Test&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Column A&lt;/td&gt;
              &lt;td&gt;&lt;%=javaBean.doSomething("apple")%&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Column B&lt;/td&gt;
              &lt;td&gt;&lt;%=javaBean.doSomething("orange")%&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Column C&lt;/td&gt;
              &lt;td&gt;&lt;%=javaBean.doSomething("pear")%&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>What is the best way to make these calls parallel e.g. run <code>doSomething("apple") &amp; doSomething("orange") &amp; doSomething("pear")</code> concurrently? Thank you.</p>