title: Check if the request parameter equals a string in Java
body: <p>I want to do this in java</p>
  
  <pre><code>if(request.getParameter("page") == "page1")
  // page1
  else if(request.getParameter("page") == "page2")
  // page2
  </code></pre>
  
  <p>For someone new to java, why doesn't the above code work, and what is the best way to do what I want to do above?</p>