title: Missing Elements in HTTP Request - Null or Empty?
body: <p>I have a HTTP Request <code>javax.servlet.http.HttpServletRequest</code> that is passing in a value to be used in some code being handled in a Java web service using JAX-RS.  The POST function in Java is consuming <code>application/json</code>.  There are two possible values to be passed into the request, call one <code>X</code> and the other <code>Y</code>, assume both are Strings.  The request requires <strong>at least</strong> one of the two possible values to be considered 'valid'.</p>
  
  <p>When the request comes in, if <code>X</code> is provided and <code>Y</code> is left out of the request entirely, what is the proper way to check to see if <code>Y</code> is there?  Would you check to see if <code>Y.isEmpty()</code> or <code>Y == null</code>?  Providing <code>X</code> doesn't guarantee <code>Y</code> is present, and vice versa.</p>