title: HttpServletRequest#getHeader("User-Agent") returns null browser name
body: <p>I'm using Java 6. I have very less knowledge of JSP and Servlets.</p>
  
  <p>I'm using the following code to get browser name in which my application is running:</p>
  
  <pre><code>String browserName = requestProvider.get().getHeader("User-Agent");
  </code></pre>
  
  <p>Also I'm using the following code to get IP address of the machine on which my application is running:</p>
  
  <pre><code>String ipAdd = requestProvider.get().getRemoteAddr();
  </code></pre>
  
  <p>In both the cases <code>requestProvider</code> is a reference variable of type <code>Provider&lt;HttpServletRequest&gt;</code>. And I'm assured that it is never <code>NULL</code>.</p>
  
  <p>Now the problem is some times I get both values (<code>browserName and ipAdd</code>) NULL.
  I've written sometimes because I don't have a test case.</p>
  
  <p>So my question is, what are the cases in Java, when these values can be NULL?</p>
  
  <p>What care should I take in coding to avoid this issue?</p>
  
  <p>Is there any alternate way to get IP address &amp; browser name every time?</p>