title: Open URL in Java to get the content
body: <p>I´m searching for a opportunity to open a url in java.</p>
  
  <pre><code>URL url = new URL("http://maps.google.at/maps?saddr=4714&amp;daddr=Marchtrenk&amp;hl=de");
      InputStream is = url.openConnection().getInputStream();
  
      BufferedReader reader = new BufferedReader( new InputStreamReader( is )  );
  
      String line = null;
      while( ( line = reader.readLine() ) != null )  {
         System.out.println(line);
      }
      reader.close();
  </code></pre>
  
  <p>I found that way.</p>
  
  <p>I added it in my program and the following error occurred.</p>
  
  <pre><code>The method openConnection() is undefined for the type URL
  </code></pre>
  
  <p>(by url.openConnection())</p>
  
  <p>What is my problem?</p>
  
  <p>I use a tomcat-server with servlets, ...</p>