title: JSP - SERVLET - calling a javascript function from a servlet
body: <p>i have a simple JSP page that calls a servlet on a click of a button and then the servlet call some internal methods to perform a task and then the time comes when the servlet action comes to an end and the goal now is, at the end of the servlet function, i want to return the control to the jsp page and soon execute a java script (there will be no event triggered, as soon as the control comes to teh jsp, the Javascript should run). how can i achieve this. as far as i have googled, it is impossible to call a javascript without any event(like a click, hover, etc) being triggered. is there a way to achieve my goal?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <pre><code>&lt;form action="http://localhost:90/Jdfront1/hello" onsubmit="return validate()"&gt;
  
  &lt;label&gt;Topic :&lt;/label&gt;&lt;input type="text" name="topic" id="topic"/&gt;&lt;br&gt;
  &lt;label&gt;Number of pages :&lt;/label&gt;&lt;input type="text" name="Nopages" id="Nopages"/&gt;&lt;br&gt;
  &lt;label&gt;URL :&lt;/label&gt;&lt;input type="text" name="link" id="link"/&gt;&lt;br&gt;
  &lt;label&gt;isRange :&lt;/label&gt;&lt;input type="text" name="range" id="range"/&gt;&lt;br&gt;
  &lt;input type="submit" value="click here!!" &gt;
  </code></pre>
  
  <p>this is the form i have.</p>