Results 1 to 2 of 2
  1. #1
    navishkumarb is offline Member
    Join Date
    Dec 2007
    Rep Power

    Default Server returned HTTP response code: 403

    hi can anyone tell me what might be the error in the following code(this is only the part of my code where the error is occuring )

    Properties systemSettings = System.getProperties();
    systemSettings.put("http.proxyHost"," ");
    systemSettings.put("http.proxyPort", "8084");
    String record = null;
    FileReadTest f = new FileReadTest();

    /*opening the text document*/
    File fi = new File("gi2.txt");
    FileInputStream fis = new FileInputStream(fi);
    BufferedInputStream bis = new BufferedInputStream(fis);
    DataInputStream dis = new DataInputStream(bis);

    while ( (record=dis.readLine()) != null )
    /*url connection*/

    URL url=new URL(""record"&dop t=fasta&dispmax=1&sendto=t&from=begin&to =end&page=1");
    HttpURLConnection urlConn = (HttpURLConnection)url.openConnection();

    /*creating a text file*/
    File create = new File(record+".txt");
    System.out.println("file already exists");
    catch(IOException e)
    System.err.println("cannot create a file");

    it was returning me the following error Server returned HTTP response code: 403 for URL: end&page=1
    at utStream<>
    at eutils.main(

  2. #2
    maruthi_s is offline Member
    Join Date
    Jan 2008
    Rep Power


    Hey the way you gave the URL is wrong, when you declare a java syntax you should be very careful. The one bolded in has caused the bug :). You did not use a escape sequence to understand the ".

    (""record"&dop t=fasta&dispmax=1&sendto=t&from=begin&to =end&page=1");

Similar Threads

  1. Server returned HTTP response code: 500.. i need help
    By hardc0d3r in forum Java Servlet
    Replies: 9
    Last Post: 03-12-2012, 09:08 PM
  2. java code for send sms through http
    By for108 in forum Java Servlet
    Replies: 11
    Last Post: 09-24-2009, 11:22 AM
  3. Replies: 1
    Last Post: 03-08-2008, 07:41 PM
  4. response.sendRedirect(url)
    By mutuah in forum Advanced Java
    Replies: 2
    Last Post: 08-07-2007, 02:56 PM
  5. Server returned HTTP response code: 500
    By Heather in forum Java Servlet
    Replies: 1
    Last Post: 07-09-2007, 05:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts