title: executing a bash script from a jsp page
body: <p>I have previously written a bash script that executes a java class, it does other checks before running that class.
  when running it takes arguments; <code>./SyncIPs.cmd 10.0.1.45</code> and executes few commands.</p>
  
  <p>I am trying to run this script in a jsp page using a html/javascript button. I have so far, two jsp files as follows:</p>
  
  <p>portal.jsp:</p>
  
  <pre><code>      &lt;%
        if(request.getParameter("submitted")==null)
    {
  
      if(check)
      {
  
          %&gt;&lt;%@include file="Sync.jsp" %&gt;&lt;%
      }
      else
      {
  
          %&gt;&lt;%@include file="Sync.jsp" %&gt;&lt;%
      }   
   }
       %&gt;
  </code></pre>
  
  <p>Sync.jsp:</p>
  
  <pre><code>   &lt;%
     if(request.getParameter("submit") == null)
     {
  
     %&gt;
      &lt;div class=display&gt;this is the Sync&lt;/div&gt;
  
      &lt;/div&gt;
  
      &lt;br&gt;
      &lt;form method="POST" action="/project/jsp/Portal.jsp" id=form2&gt;
  
  
    &lt;input type=hidden name=sync&gt;
        &lt;!---this is where I want my script to be run from,---&gt;
  
     &lt;input type="button" value="" name="submit" action="run" 
     onClick="if(runOnSubmit()){getSomethingWithAjax
     ('Portal.jsp'+getAllFormElementsAndMakeIntoURI(true),
     '','hereIsTheMainHeaderSpan',false,false);}"&gt;
     &lt;%
     }//end if
     %&gt;
  </code></pre>
  
  <p>How do I get this script to run and get posted on the portal.jsp page?</p>