why does getByName() fails?

Discussion in 'Java' started by FB, Aug 3, 2004.

  1. FB

    FB Guest

    I have an applet that checks it's origins but sometimes it just fails...

    if the browser can resolve
    http://www.somedomain.com/somefolder/somepage.html why the applet won't
    resolve www.somedomain.com?

    code used:

    sref = this.getDocumentBase().getHost();

    try
    {
    hip = hip.getByName(sref);
    ship = hip.toString();
    }
    catch(UnknownHostException uhe)
    {
    ship = "[" + this.getDocumentBase().toString() + "][" + sref + "]";
    }

    System.out.println(ship);


    it fails about 5% of the time...

    thanks for any help

    FB
     
    FB, Aug 3, 2004
    #1
    1. Advertising

  2. Andrew Thompson, Aug 3, 2004
    #2
    1. Advertising

  3. On Tue, 3 Aug 2004 12:05:15 -0300, FB wrote:
    > I have an applet that checks it's origins but sometimes it just
    > fails...
    >
    > if the browser can resolve
    > http://www.somedomain.com/somefolder/somepage.html why the applet
    > won't resolve www.somedomain.com?


    Does the browser use a proxy? If so, it's the proxy that does the
    lookup on its behalf.

    /gordon

    --
    [ do not email me copies of your followups ]
    g o r d o n + n e w s @ b a l d e r 1 3 . s e
     
    Gordon Beaton, Aug 3, 2004
    #3
  4. FB

    FB Guest

    "Andrew Thompson" <> wrote in message
    news:urblskporusi.477ygzx0y3db$...
    : On Tue, 3 Aug 2004 12:05:15 -0300, FB wrote:
    :
    : > I have an applet
    :
    : URL?
    :
    : >..that checks it's origins but sometimes it just fails...
    :
    : <http://www.physci.org/codes/javafaq.jsp#exact>
    :

    sorry, I should have said that I get the message from the catch part,
    meaning it didn't get resolved...


    : --
    : Andrew Thompson
    : http://www.PhySci.org/ Open-source software suite
    : http://www.PhySci.org/codes/ Web & IT Help
    : http://www.1point1C.org/ Science & Technology
     
    FB, Aug 3, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. -
    Replies:
    2
    Views:
    631
  2. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    921
    Mark Rae
    Dec 21, 2006
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,072
    Smokey Grindel
    Dec 2, 2006
  4. Jack Dowson

    Query about method getByName()?

    Jack Dowson, May 16, 2007, in forum: Java
    Replies:
    1
    Views:
    266
    Eric Sosman
    May 16, 2007
  5. saggar
    Replies:
    2
    Views:
    1,363
    lewbloch
    Jun 17, 2011
Loading...

Share This Page