title: Help using JAVA URL in a Google Web Toolkit project
body: <p>I'm trying to implement java URL into my gwt project. This is what I've done so far in terms of experimenting, trial-error, etc:
  HTML:</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;meta http-equiv="content-type" content="text/html; charset=UTF-8"&gt; 
      &lt;link type="text/css" rel="stylesheet" href="Test_project.css"&gt;
      &lt;title&gt;John Mathew's Google AJAX Search API Sample&lt;/title&gt;      
      &lt;script src="http://www.google.com/jsapi?key=*insert google api key*" type="text/javascript"&gt;&lt;/script&gt;  
      &lt;script type="text/javascript"&gt;
          google.load('search', '1');  
          google.setOnLoadCallback(function(){
              var searchControl = new google.search.SearchControl();
              searchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET);     
              searchControl.addSearcher(new google.search.WebSearch());
              var drawOptions = new google.search.DrawOptions();
          drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_TABBED);     
              searchControl.draw(document.getElementById("content"), drawOptions);           
          }, true); 
  &lt;/script&gt;
  
  &lt;script src="http://www.google.com/jsapi" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      google.load('search', '1', {language : 'en', style : google.loader.themes.SHINY});
  google.setOnLoadCallback(function() {
       var customSearchControl = new google.search.CustomSearchControl('*insert google cse id*');
       CustomSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
       customSearchControl.draw('cse');
  }, true);
  &lt;/script&gt;
  &lt;script type="text/javascript" language="javascript" src="test_project/test_project.nocache.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>
    
          Loading...
          
              document.writeln('search engine 2');
          <br>
      Loading...<br>
          
              document.writeln('search engine 3');
                 </p>
  
  <pre><code>&lt;div id="customSearch"&gt;&lt;/div&gt;       
  </code></pre>
  
  <p>
  </p>
  
  <p>Now both parts of the javascript generates a google textbox and button. Upon entering information, it will return results. This isn't what I want. I would like to obtain the results for me to manipulate and play around with. So I did a bit of research and discovered PHP get_file_contents() and JAVA URL(). I've never had PHP experience so I went with Java (there is JQuery get() but I am confused on how to implement and couldn't find examples).</p>
  
  <p>To understand how Java URL() works, I created a Java project and learned of this code:</p>
  
  <pre><code>URL urlsearch = new URL("*insert website*");        
  BufferedReader buffreader = new BufferedReader(new InputStreamReader(urlsearch.openStream()));        
  String HTMLdisplay;
  while ((HTMLdisplay = buffreader.readLine()) != null) {
     System.out.println(HTMLdisplay);
  }
  buffreader.close();
  </code></pre>
  
  <p>It works exactly how I wanted as it retrieves the html page source of a page (example: <a href="http://www.bing.com/search?q=gygax" rel="nofollow">http://www.bing.com/search?q=gygax</a>). To implement this, I created a project based on how <a href="http://code.google.com/webtoolkit/doc/latest/tutorial/create.html" rel="nofollow">http://code.google.com/webtoolkit/doc/latest/tutorial/create.html</a> instructs thus in the HTML code above there is the line . The command that links the two is in the class <code>onModuleLoad():
  // Associate the Main panel with the HTML host page.
  RootPanel.get("customSearch").add(mainPanel);</code></p>
  
  <p>This sounds a bit confusing so I'll summarize a bit: using Google Widgets on my .java I created a textbox and button when I run it as a web application. When you click the button, it is suppose execute the java url code and retrieve the pagesource on what it queries. Instead I get these errors:</p>
  
  <pre><code>[DEBUG] [test_project] - Validating newly compiled units
  [ERROR] [test_project] - Errors in 'file:/C:/*file path*/Test_project.java'
  [ERROR] [test_project] - Line 92: No source code is available for type java.net.URL; did you forget to inherit a required module?
  [ERROR] [test_project] - Line 93: No source code is available for type java.io.BufferedReader; did you forget to inherit a required module?
  [ERROR] [test_project] - Line 93: No source code is available for type java.io.InputStreamReader; did you forget to inherit a required module?
  [ERROR] [test_project] - Line 99: No source code is available for type java.net.MalformedURLException; did you forget to inherit a required module?
  [ERROR] [test_project] - Line 102: The method exit(int) is undefined for the type System
  [ERROR] [test_project] - Line 107: The method exit(int) is undefined for the type System
  [TRACE] [test_project] - Finding entry point classes
  [ERROR] [test_project] - Unable to find type 'com.example.test_project.client.Test_project'
  [ERROR] [test_project] - Hint: Previous compiler errors may have made this type unavailable
  [ERROR] [test_project] - Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
  [ERROR] [test_project] - Failed to load module 'test_project' from user agent 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15 ( .NET CLR 3.5.30729; .NET4.0E)' at localhost:3410
  </code></pre>
  
  <p>I have import <code>java.io.* and import java.net.*</code> (have tried specific packages too) along with the many <code>com.google.gwt</code> packages.</p>
  
  <p>MY QUESTION: How do I overcome these errors that prevent me from using JAVA URL in my GWT project?</p>