title: Call JSP method from javascript
body: <p>I have the above js and JSP code, I want to invoke <code>procedureCall()</code> while clicking on <code>ok</code> button on confirm window poopup (inside "if" statement). <strong>Is it possible and if yes, how it can be done?</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
          function confirmDelete() {
              var answer = confirm("Are you sure you want to delete");
              if (answer == true) {
                  return true;
              } else {
                  return false;
              }
          }
  &lt;/script&gt;
  </code></pre>
  
  <p>JSP piece:</p>
  
  <pre><code>&lt;%!    public void procedureCall(int cId) {
              String procedureCall = "{call NEW_PORTING_PRC.delete_album_metadata(cId)}";
                  try (CallableStatement cal = conn.prepareCall(procedureCall);) {
  
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
  %&gt;
  </code></pre>