title: Call a servlet page from a jsp page onload event only once
body: <p>I have a jsp page in which I want to show 2 list to be populated using the values return by the servlet .this should happen as soon as the jsp page gets loaded so I called the servlet through the onload function of the jsp page . I am able to get the lists on the page but it went up to an infinite loop calling servlet again and again and displaying the same values.</p>
  
  <p>In my test2.jsp,i am using this to call servlet on loading the jsp page</p>
  
  <pre><code>function load()
  {
  
  document.location.href="/OnaUIDemo/ona?";
  
  }
  </code></pre>
  
  <p>in my ona servlet i am using this ,</p>
  
  <pre><code>RequestDispatcher rd = getServletContext().getRequestDispatcher("/test2.jsp");
  </code></pre>
  
  <p>what I figure out is that , because its calling the servlet through page load and also the servlet is redirecting to the same jsp. jsp is getting load again causing infinite load again and again.
  please help me to control the servlet call to only once.</p>