title: How do I separate out query string params from POST data in a java servlet
body: <p>When you get a doGet or doPost call in a servlet you can use <code>getparameterxxx()</code> to get either the query string or the post data in one easy place.<br>
  If the call was a GET, you get data from the url/query string.<br>
  If the call was a POST, you get the post data all parsed out for you.</p>
  
  <p>Except as it turns out, if you don't put an 'action' attribute in your form call.
  If you specify a fully qualified or partially qualified url for the action param everything works great, if you don't, the browser will call the same url as it did on the previous page submit, and if there happens to be query string data there, you'll get that as well as POST data, and there's no way to tell them apart.</p>
  
  <p>Or is there?
  I'm looking through the request object, I see where the post data comes from, I'm just trying to figure out where the GET data comes from, so I can erase the GET data on a post call and erase the post data on a GET call before it parses it out if possible.</p>
  
  <p>Any idea what the safe way to do this is?</p>
  
  <p>And lemme guess: you never tried to not put an action field in a form tag. :-)</p>