title: JSP validate user is coming from previous page
body: <p>In my JSP webapp, i want to validate that a user is coming from a specific page of mine, <code>http://myapplication.com/foo.jsp</code>. On the page doing the checking, I could do:</p>
  
  <pre><code>String ref = request.getHeader("referer");
  </code></pre>
  
  <p>Then compare <code>ref</code> to <code>http://myapplication.com/foo.jsp</code></p>
  
  <p>However, this validation can be easily spoofed. What are some other techniques to verify that a client is coming from an expected URL?</p>
  
  <p>I imagine this has come up before in SO.
  Thanks </p>
  
  <p>PR</p>