title: Why didn't my page refresh when using location.reload()?
body: <p>I know this has been asked multiple times on here, but I would like some input.</p>
  
  <p>The web app I'm working on displays a table from a database via Freemarker.  It includes a submit button to delete entries from that database.  The button works fine for sending requests, but I wanted to have it automatically refresh the page, to show the new table without that entry.  I tried this:</p>
  
  <pre><code>&lt;form onsubmit="location.reload()" method="post" action="http://localhost:8080/person/delete/${profile.id};"&gt;
  &lt;input type="submit" value="Delete"&gt;&lt;/form&gt;
  </code></pre>
  
  <p>and this:</p>
  
  <pre><code>&lt;form onsubmit="location.reload()" method="post" action="http://localhost:8080/person/delete/${profile.id};"&gt;
  &lt;input type="submit" value="Delete"&gt;&lt;/form&gt;
  </code></pre>
  
  <p>Neither had any affect.  Further research showed me that reload() will refresh the page from the cache, unless forceGet is set to true.  I did this for both methods, and saw no difference.  Then I thought that it was a case of the page refreshing before it could get the updated information from the server, so I had it wait 100 ms:</p>
  
  <pre><code>&lt;script&gt;
      function reloadPage() {
          setTimeout(function () {
              location.reload();
          }, 100)
      }
  &lt;/script&gt;
  &lt;form onsubmit="reloadPage()" method="post" action="http://localhost:8080/person/delete/${profile.id};"&gt;
                          &lt;input type="submit" value="Delete"&gt;&lt;/form&gt;
  </code></pre>
  
  <p>This works, but I'd like to know if there is any insight on why the original methods wouldn't work.  Also, are there any suggestions on alternatives to my code?</p>
  
  <p>Edit:</p>
  
  <p>To clarify, the path <a href="http://localhost:8080/person/delete/" rel="nofollow noreferrer">http://localhost:8080/person/delete/</a>${profile.id}; doesn't lead to a page; its meant to call the method in the method in the resource class that will run the delete method:</p>
  
  <pre><code>@POST
  @Path("/delete/{id}")
  public void deleteProfile(@PathParam("id") int id) {
      manager.deleteProfile(id);
  }
  </code></pre>