title: java.net.MalformedURLException java.net.URL.<init>(Unknown Source)
body: <p>I keep getting this error and I really dont know why. I have tried different URLs but I still get the same error.</p>
  
  <p><strong>java.net.MalformedURLException
      java.net.URL.(Unknown Source)</strong></p>
  
  <pre><code>public class ProxyServlet extends HttpServlet {
  
  private String PostUrl = "http://localhost:8080/myProxy/myServlet";
  
  private static final long serialVersionUID = 1L;
  
  public ProxyServlet() {
      super();
      }
  
  protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  
      System.out.println("Parameters retreived...");
      // map parameters to properties in config file and set response
      Map();
      }
  
  private void Map() throws IOException{
  
  
          String urlParameters = "topic="+topic+"&amp;item="+item+"&amp;period="+period+";
          URL url = new URL(PostUrl);
          HttpURLConnection conn = (HttpURLConnection)url.openConnection();
          System.out.println("Connection made to " + PostUrl);
          conn.setDoOutput(true);
          conn.setInstanceFollowRedirects(true);
          conn.setRequestMethod("POST");
          conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
          conn.setRequestProperty("charset", "utf-8");
  
          OutputStream out = null;
  
          try{
              System.out.println("Writing data to output stream...");
              out = conn.getOutputStream();
              out.write(urlParameters.getBytes());
              out.close();
              System.out.println("All done!!!");
          }
  
          catch(IOException e){
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>Any help would be appreciated!!</p>
  
  <p>Thanks!</p>